package com.dhcc.DRGsHosp.facade.impl;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import javax.inject.Inject;
import javax.inject.Named;

import org.springframework.beans.factory.annotation.Autowired;

import com.dhcc.DRGsHosp.application.BZAnalysisDRGsReportApplication;
import com.dhcc.DRGsHosp.facade.BZAnalysisDRGsReportFacade;
import com.dhcc.DRGsHosp.facade.DrgsIndexCalFacade;
import com.dhcc.DRGsHosp.infra.util.Arith;
import com.dhcc.DRGsHosp.infra.util.CustomXWPFDocument;
import com.dhcc.DRGsHosp.infra.util.GetAbnormity;
import com.dhcc.DRGsHosp.infra.util.DrgsIndex;
import com.dhcc.DRGsHosp.infra.util.WordUtil;

/**
 * 
  * @Description:北肿新版分析报告导出-POI技术
  * @Author:sulina
  * @Date:2017年12月28日 下午2:25:40 
  * @version :2.3.2
  * @copyright:DHC 2015-2016
 */
@Named("drgsHospFacadeImplbz")
public class BZAnalysisDRGsReportFacadeImpl implements BZAnalysisDRGsReportFacade  {

	@Autowired
	private  BZAnalysisDRGsReportApplication analysisDRGsReportApplication;
	
	@Inject
	private DrgsIndexCalFacade drgsIndexCalFacade;
	
	//存放全部信息的map
	private static Map<String,Object> params= new HashMap<String,Object>();
	//存放图片信息的map
	private static Map<String,Object> allMap= new HashMap<String,Object>();
	
	private static String picRootio;
	private static String wordRootio;
	private static String writeRootio;
	
	private static  long start ;
	private static  long reportNo;
	
	private static List<List<String>> resultListSeven=new ArrayList<List<String>>(); //保持7表格信息
	private static List<List<String>> resultListEight=new ArrayList<List<String>>(); //保持表格8信息
	private static List<List<String>> resultListNine=new ArrayList<List<String>>(); //保持表格9信息
	private static List<List<String>> resultListTen=new ArrayList<List<String>>(); //保持表格10信息
	private static List<List<String>> resultListEleven=new ArrayList<List<String>>(); //保持表格11信息
	private static List<List<String>> resultListTwelve=new ArrayList<List<String>>(); //保持表格12信息
	private static List<List<String>> resultListThirteen=new ArrayList<List<String>>(); //保持表格13信息
	
	private static List<List<String>> resultListFBOne=new ArrayList<List<String>>(); //保持附表1信息
	private static List<List<String>> resultListFBTwo=new ArrayList<List<String>>(); //保持附表2信息
	private static List<List<String>> resultListFBThree=new ArrayList<List<String>>(); //保持附表3信息
	private static List<List<String>> resultListFBFour=new ArrayList<List<String>>(); //保持附表4信息
	private static List<List<String>> resultListFBFive=new ArrayList<List<String>>(); //保持附表5信息
	private static List<List<String>> resultListFBSix=new ArrayList<List<String>>(); //保持附表6信息
	private static List<List<String>> resultListFBSeven=new ArrayList<List<String>>(); //保持附表7信息
	private static List<List<String>> resultListFBEight=new ArrayList<List<String>>(); //保持附表8信息
	private static List<List<String>> resultListFBNine=new ArrayList<List<String>>(); //保持附表9信息
	
	//检测散点图中是否有异常数据
	Map<String, List<Map<String, Object>>>  abnormalMap = new HashMap<>();
	GetAbnormity abnorm = new GetAbnormity();// 调用是否有异常数据方法
	/**
	 * 
	  * @Description: 获取当前系统中可用标杆 
	  * @return
	 */
	@Override
	public List<Map<String,Object>> getARBenchmarkYear() {
		return analysisDRGsReportApplication.getARBenchmarkYear();
	}
	/**
	 * 获取当前系统库中所有的临床专业
	 * @return
	 */
	@Override
	public List<Map<String, Object>> getARBenchSpecCode() {
		return analysisDRGsReportApplication.getARBenchSpecCode();
	}
	/**
	 * 
	 * TODO 主方法
	 * 
	 * @author sulina  
	 * @see com.dhcc.DRGsHosp.facade.AnalysisDRGsReportFacade#createDRGsReport(java.util.Map)
	 */
	@Override
	public Map<String, Object> findARDRGsReport(Map<String, Object> dto) {
		
		start = System.currentTimeMillis(); //生成文档开始时间
		allMap=new HashMap<>();
		Map<String,Object> paramMap= new HashMap<String,Object>();
		
		//存放分析报告图片位置地址
		picRootio=dto.get("picRoot")+"";
		//存放分析报告文档位置地址
		wordRootio=dto.get("wordRoot")+"";
		//存放生成的分析报告文档位置地址
		writeRootio=dto.get("writeRoot")+"";
		
		String dateFrom=dto.get("dateFrom")==null?"":dto.get("dateFrom").toString();  //起始日期
		String dateTo=dto.get("dateTo")==null?"":dto.get("dateTo").toString();        //终止日期
		dateFrom=DrgsIndex.formateDateFrom(dateFrom);          //规范日期格式
		dateTo=DrgsIndex.formateDateTo(dateTo);
		
//		String benchmarkYear=dto.get("benchmarkYear")==null?"":dto.get("benchmarkYear").toString();  //标杆年份
		String isComplete=(dto.get("isComplete")==null?"":dto.get("isComplete").toString()); //是否进行数据完整性校验
//		String drgVersion=dto.get("groupVersion")==null?"":dto.get("groupVersion").toString();  //当前分组器版本
		String hospCode=dto.get("hospCode")==null?"":dto.get("hospCode").toString();  //院区选择
		String benchmarkYear=drgsIndexCalFacade.getStdID(dateFrom,dateTo);   //获取标杆定位id
		if(benchmarkYear==null){
			 allMap.put("errorMessageData" ,"您没有进行条件配置，请在右上角进行配置");
			 return allMap;
		}
		String drgVersion=drgsIndexCalFacade.getVerCode(dateFrom, dateTo);
		//装填重要信息
		paramMap.put("dateFrom", dateFrom);
		paramMap.put("dateTo", dateTo);
		paramMap.put("benchmarkYear", benchmarkYear);
		paramMap.put("drgVersion", drgVersion);
		paramMap.put("hospCode", hospCode);
		
		   //判断有没有数据
				int dataIsNull=analysisDRGsReportApplication.findARDataIsNull(dateFrom, dateTo,drgVersion,hospCode);
				
				if(dataIsNull!=0){
					List<Map<String,Object>> drgsList = analysisDRGsReportApplication.findARNewDrgs(dateFrom, dateTo, benchmarkYear ,drgVersion,hospCode);
					
					if (!drgsList.isEmpty()) {
						Map<String, Object> nmap = new HashMap<String, Object>();
						nmap.put("newdrgs", 1);
						nmap.put("drgsList", drgsList);
						return nmap;
					} else {
						//数据完整性校验
						List<Map<String,Object>> checkedList = analysisDRGsReportApplication.findARCheckedData(dateFrom, dateTo, benchmarkYear ,drgVersion, hospCode);
						Map<String,Object> objch=checkedList.get(0);
						double operlevelRatio=objch.get("FIRST_JUDGE_VALUE")==null?0:Double.valueOf(objch.get("FIRST_JUDGE_VALUE").toString());
						double opercodeRatio=objch.get("TWO_JUDGE_VALUE")==null?0:Double.valueOf(objch.get("TWO_JUDGE_VALUE").toString());
						double opertypeRatio=objch.get("THREE_JUDGE_VALUE")==null?0:Double.valueOf(objch.get("THREE_JUDGE_VALUE").toString());
						double ditypeRatio=objch.get("FOUR_JUDGE_VALUE")==null?0:Double.valueOf(objch.get("FOUR_JUDGE_VALUE").toString());
						double dicodeRatio=objch.get("FIVE_JUDGE_VALUE")==null?0:Double.valueOf(objch.get("FIVE_JUDGE_VALUE").toString());
					
					  if (isComplete.trim().equals("1")&&(operlevelRatio <0.85 ||opercodeRatio<0.85|| opertypeRatio<0.85||ditypeRatio<0.85||dicodeRatio<0.85)) {
						  allMap.put("errorMessageData" ,"请检测您导入的数据中手术编码、手术级别、手术类型、诊断编码、诊断类型是否符合数据规范！");
						  return allMap;
						}else {
							//进行主要手术的手术操作判断
							String caseOperCount = analysisDRGsReportApplication.findHospCaseOperationCount(paramMap);
							if(Double.valueOf(caseOperCount).intValue()>=1){
							}else{
								//查看系统配置表中手术编码版本
								String hospCaseOperationVersion = analysisDRGsReportApplication.findHospCaseOperationVersion(paramMap);
								if(hospCaseOperationVersion==null){
									allMap.put("errorMessageData" ,"需在系统配置功能中做手术编码版本配置");
									return allMap;
								}else{
									paramMap.put("operVersion", hospCaseOperationVersion+"");
									//查看系统配置表中手术编码版本
									String hospCaseOperVersionCnt = analysisDRGsReportApplication.findHospCaseOperVersionCnt(paramMap);
									if(Double.valueOf(hospCaseOperVersionCnt).intValue()>=1){
										//更新手术操作字段
										 analysisDRGsReportApplication.updateHospCaseOper(paramMap);
									}else{
										allMap.put("errorMessageData" ,"您选取的手术编码版本在字典表没有区分手术操作数据，请重新选择");
										return allMap;
									}
								}
							}
							caseOperCount = analysisDRGsReportApplication.findHospCaseOperationCount(paramMap);
							if(Double.valueOf(caseOperCount).intValue()>=1){
							}else{
								allMap.put("errorMessageData" ,"手术操作字段仍未区分，请重新操作");
								return allMap;
							}
							
							//医院基础信息单独处理,方便下面的做分母调用，不然报空指针异常的bug
							loadARHospDataSection(dto);
							//多线程处理
							ExecutorService indexPool = Executors.newFixedThreadPool(7);
							indexPool.execute(new TestRunnableA(dto)); 
							indexPool.execute(new TestRunnableB(dto, paramMap)); 
							indexPool.execute(new TestRunnableC(dto, paramMap)); 
							indexPool.execute(new TestRunnableD(dto, paramMap)); 
							indexPool.execute(new TestRunnableE(dto, paramMap)); 
							indexPool.execute(new TestRunnableF(dto, paramMap)); 
							indexPool.execute(new TestRunnableG(dto, paramMap)); 
							//关闭线程池
							indexPool.shutdown();
							//线程池里所有线程走完
							 while(true){
						           if(indexPool.isTerminated()){
						                System.out.println("所有的子线程都结束了！");  
						                break;  
						            }  
						       }
							  return allMap;
							
						}
						
					}
				}else{
					 allMap.put("errorMessageData" ,"您选择的时间段内无数据, 生成文档失败");
					 return allMap;
				}
	}
	//医院基础信息单独处理,方便计算做分母调用
	public void loadARHospDataSection(Map<String, Object> dto){
		// 获取出院病历术，大于60.入组数， 入组率
		String dateFrom=dto.get("dateFrom")==null?"":dto.get("dateFrom").toString();  //起始日期
		String dateTo=dto.get("dateTo")==null?"":dto.get("dateTo").toString();        //终止日期
		String drgVersion=drgsIndexCalFacade.getVerCode(dateFrom, dateTo);
		String hospCode=dto.get("hospCode")==null?"":dto.get("hospCode").toString();  //院区选择
		List<Map<String,Object>> hospBaseQuotaStOne = analysisDRGsReportApplication.findARSimpHospBaseQuota(drgVersion,dateFrom,dateTo,hospCode);
		Map<String,Object> hospBaseQuotaStOneMap=hospBaseQuotaStOne.get(0);
		params.put("hospoutcasecnt", hospBaseQuotaStOneMap.get("ALLCNT") == null ? "0": Arith.dataFormat(hospBaseQuotaStOneMap.get("ALLCNT").toString(), "2"));// 出院病例数
		params.put("hospoutcasecnt_temp", hospBaseQuotaStOneMap.get("ALLCNT") == null ? "0": Integer.parseInt(hospBaseQuotaStOneMap.get("ALLCNT")+""));// 出院病例数 (未格式化)
		params.put("ingpcacnt",hospBaseQuotaStOneMap.get("INGROUP") == null ? "0" : Arith.dataFormat(hospBaseQuotaStOneMap.get("INGROUP").toString(), "2"));// 入组数
		params.put("ingroupcasecnt_temp",hospBaseQuotaStOneMap.get("INGROUP") == null ? "0" : hospBaseQuotaStOneMap.get("INGROUP").toString());// 入组数 (未格式化)
		params.put("oversixtycasecnt", hospBaseQuotaStOneMap.get("OVERSIXTY") == null ? "0" :Arith.dataFormat(hospBaseQuotaStOneMap.get("OVERSIXTY").toString(), "2"));// 大于60
		params.put("oversixtycasecnt_temp", hospBaseQuotaStOneMap.get("OVERSIXTY") == null ? "0" : hospBaseQuotaStOneMap.get("OVERSIXTY").toString());// 大于60 (未格式化)
		params.put("ingroupRatio", (hospBaseQuotaStOneMap.get("GROUPRATIO") == null ? 0 : hospBaseQuotaStOneMap.get("GROUPRATIO")));// 入组率
		params.put("notingrocasecnt", hospBaseQuotaStOneMap.get("NOTINGROUP") == null ? "0": Arith.dataFormat(hospBaseQuotaStOneMap.get("NOTINGROUP").toString(), "2"));// 未入组
		params.put("notingrocasecnt_temp", hospBaseQuotaStOneMap.get("NOTINGROUP") == null ? "0": hospBaseQuotaStOneMap.get("NOTINGROUP").toString().trim());// 未入组 (未格式化)
	
	
	}
	//加载第一个章节信息
	public void loadARFirstSection(Map<String, Object> dto){
		
		// 获取医院名称
	    String hospName=dto.get("hospName")==null?"--":dto.get("hospName").toString().trim();
	    String hospCode=dto.get("hospCode")==null?"":dto.get("hospCode").toString();  //院区选择
/*		if(hospName.endsWith("医院")){
			hospName=hospName.substring(0, hospName.length()-2);
		}*/
		params.put("hospName", hospName);
		
		// 获取导出分析报告日期
		Calendar cal = Calendar.getInstance();// 使用日历类
		String year = cal.get(Calendar.YEAR) + "";// 得到年
		String month = (cal.get(Calendar.MONTH) + 1) + "";// 得到月，因为从0开始的，所以要加1
		params.put("createYear", year);
		params.put("createMonth", month);
		
		//加载年份信息
		String dateFrom=dto.get("dateFrom")==null?"":dto.get("dateFrom").toString();  //起始日期
		String dateTo=dto.get("dateTo")==null?"":dto.get("dateTo").toString();        //终止日期
		String dateFromCc = DrgsIndex.getDateFromCc(dateFrom,"year");//起始日期同期
		String dateToCc = DrgsIndex.getDateFromCc(dateTo,"year");//终止日期同期
		String analysisyear = dateFrom.substring(0, 4);// 分析开始的年份
		String analysisdateTo = dateTo.substring(0, 4);// 分析结束的年份
		String analysisyearCc = dateFromCc.substring(0, 4);// 分析开始的年份同期
		String analysisdateToCc = dateToCc.substring(0, 4);// 分析结束的年份同期
		String analysismonthfrom="";//分析开始的月份
		String analysismonthto=""; //分析结束的月份
		if(dateFrom.substring(5,6).equals("0")){
			analysismonthfrom=dateFrom.substring(6, 7); 
		}else {
			analysismonthfrom=dateFrom.substring(5, 7);
		}
		if(dateTo.substring(5,6).equals("0")){
			analysismonthto=dateTo.substring(6, 7); 
		}else {
			analysismonthto=dateTo.substring(5, 7);
		}		
		params.put("analysisYear", analysisyear);
		if(!analysisyear.equals(analysisdateTo)){
			params.put("analysisNewTime",analysisyear+"年"+analysismonthfrom+"月至"+analysisdateTo+"年"+analysismonthto+"月" );
			params.put("analysisNewSumTime",analysisyear+"年1月至"+analysisdateTo+"年"+analysismonthto+"月" );
			params.put("analysisNewccTime",analysisyearCc+"年"+analysismonthfrom+"月至"+analysisdateToCc+"年"+analysismonthto+"月" );
			params.put("analysisNewccSumTime",analysisyearCc+"年1月至"+analysisdateToCc+"年"+analysismonthto+"月");
		}else if(analysisyear.equals(analysisdateTo)&&analysismonthfrom.equals("1")&&analysismonthto.equals("12")){
			params.put("analysisNewTime",analysisyear+"年");
			params.put("analysisNewSumTime",analysisyear+"年");
			params.put("analysisNewccTime",analysisyearCc+"年");
			params.put("analysisNewccSumTime",analysisyearCc+"年");
		}else if(analysisyear.equals(analysisdateTo)&&analysismonthfrom.equals(analysismonthto)&&!analysismonthfrom.equals("1")){
			params.put("analysisNewTime",analysisyear+"年"+analysismonthfrom+"月" );
			params.put("analysisNewSumTime",analysisyear+"年1至"+analysismonthfrom+"月" );
			params.put("analysisNewccTime",analysisyearCc+"年"+analysismonthfrom+"月" );
			params.put("analysisNewccSumTime",analysisyearCc+"年1至"+analysismonthfrom+"月" );
		}else if(analysisyear.equals(analysisdateTo)&&analysismonthfrom.equals(analysismonthto)&&analysismonthfrom.equals("1")){
			params.put("analysisNewTime",analysisyear+"年"+analysismonthfrom+"月" );
			params.put("analysisNewSumTime",analysisyear+"年"+analysismonthfrom+"月" );
			params.put("analysisNewccTime",analysisyearCc+"年"+analysismonthfrom+"月" );
			params.put("analysisNewccSumTime",analysisyearCc+"年"+analysismonthfrom+"月" );
		}else{
			params.put("analysisNewTime",analysisyear+"年"+analysismonthfrom+"至"+analysismonthto+"月" );
			params.put("analysisNewSumTime",analysisyear+"年"+analysismonthfrom+"至"+analysismonthto+"月" );
			params.put("analysisNewccTime",analysisyearCc+"年"+analysismonthfrom+"至"+analysismonthto+"月" );
			params.put("analysisNewccSumTime",analysisyearCc+"年"+analysismonthfrom+"至"+analysismonthto+"月" );
		}
		
		// 表格一中出院病例数、入组病例数、入组率等累计值
		String dateFromSum=dateFrom.substring(0,4)+"-01-01";  //累计值起始日期
		String drgVersion=drgsIndexCalFacade.getVerCode(dateFrom, dateTo);
		List<Map<String,Object>> hospBaseQuotaSum = analysisDRGsReportApplication.findARSimpHospBaseQuota(drgVersion,dateFromSum,dateTo,hospCode);
		Map<String,Object> hospBaseQuotaSumMap=hospBaseQuotaSum.get(0);
		params.put("hospoutcasecntsum", hospBaseQuotaSumMap.get("ALLCNT") == null ? "0": Arith.dataFormat(hospBaseQuotaSumMap.get("ALLCNT").toString(), "2"));// 出院病例数
		params.put("ingpcacntsum",hospBaseQuotaSumMap.get("INGROUP") == null ? "0" : Arith.dataFormat(hospBaseQuotaSumMap.get("INGROUP").toString(), "2"));// 入组数
		params.put("oversixtycasecntsum", hospBaseQuotaSumMap.get("OVERSIXTY") == null ? "0" :Arith.dataFormat(hospBaseQuotaSumMap.get("OVERSIXTY").toString(), "2"));// 大于60
		params.put("ingroupRatiosum", (hospBaseQuotaSumMap.get("GROUPRATIO") == null ? 0 : hospBaseQuotaSumMap.get("GROUPRATIO")));// 入组率
		params.put("notingrocasecntsum", hospBaseQuotaSumMap.get("NOTINGROUP") == null ? "0": Arith.dataFormat(hospBaseQuotaSumMap.get("NOTINGROUP").toString(), "2"));// 未入组
		
		// 表格一中出院病例数、入组病例数、入组率等同期值
		List<Map<String,Object>> hospBaseQuotaCc = analysisDRGsReportApplication.findARSimpHospBaseQuota(drgVersion,dateFromCc,dateToCc,hospCode);
		Map<String,Object> hospBaseQuotaCcMap=hospBaseQuotaCc.get(0);
		params.put("hospoutcasecntcc", hospBaseQuotaCcMap.get("ALLCNT") == null ? "0": Arith.dataFormat(hospBaseQuotaCcMap.get("ALLCNT").toString(), "2"));// 出院病例数
		params.put("ingpcacntcc",hospBaseQuotaCcMap.get("INGROUP") == null ? "0" : Arith.dataFormat(hospBaseQuotaCcMap.get("INGROUP").toString(), "2"));// 入组数
		params.put("oversixtycasecntcc", hospBaseQuotaCcMap.get("OVERSIXTY") == null ? "0" :Arith.dataFormat(hospBaseQuotaCcMap.get("OVERSIXTY").toString(), "2"));// 大于60
		params.put("ingroupRatiocc", (hospBaseQuotaCcMap.get("GROUPRATIO") == null ? 0 : hospBaseQuotaCcMap.get("GROUPRATIO")));// 入组率
		params.put("notingrocasecntcc", hospBaseQuotaCcMap.get("NOTINGROUP") == null ? "0": Arith.dataFormat(hospBaseQuotaCcMap.get("NOTINGROUP").toString(), "2"));// 未入组
		
		// 表格一中出院病例数、入组病例数、入组率等同期累计值
		String dateFromCcSum=dateFromCc.substring(0,4)+"-01-01";  //累计值起始日期
		List<Map<String,Object>> hospBaseQuotaCcSum = analysisDRGsReportApplication.findARSimpHospBaseQuota(drgVersion,dateFromCcSum,dateToCc,hospCode);
		Map<String,Object> hospBaseQuotaCcSumMap=hospBaseQuotaCcSum.get(0);
		params.put("hospoutcasecntccsum", hospBaseQuotaCcSumMap.get("ALLCNT") == null ? "0": Arith.dataFormat(hospBaseQuotaCcSumMap.get("ALLCNT").toString(), "2"));// 出院病例数
		params.put("ingpcacntccsum",hospBaseQuotaCcSumMap.get("INGROUP") == null ? "0" : Arith.dataFormat(hospBaseQuotaCcSumMap.get("INGROUP").toString(), "2"));// 入组数
		params.put("oversixtycasecntccsum", hospBaseQuotaCcSumMap.get("OVERSIXTY") == null ? "0" :Arith.dataFormat(hospBaseQuotaCcSumMap.get("OVERSIXTY").toString(), "2"));// 大于60
		params.put("ingroupRatioccsum", (hospBaseQuotaCcSumMap.get("GROUPRATIO") == null ? 0 : hospBaseQuotaCcSumMap.get("GROUPRATIO")));// 入组率
		params.put("notingrocasecntccsum", hospBaseQuotaCcSumMap.get("NOTINGROUP") == null ? "0": Arith.dataFormat(hospBaseQuotaCcSumMap.get("NOTINGROUP").toString(), "2"));// 未入组
		
		//表格一中同期比
		double hospoutcasecnt=Double.valueOf(params.get("hospoutcasecnt_temp") + "");
		double hospoutcasecntcc=Double.valueOf(String.valueOf(hospBaseQuotaCcMap.get("ALLCNT") == null ? 0 : hospBaseQuotaCcMap.get("ALLCNT").toString()));
		double hospoutcasecntRatioV=imputedRatio((hospoutcasecnt-hospoutcasecntcc),hospoutcasecntcc);
		String hospoutcasecntRatio="";
		if(hospoutcasecnt>hospoutcasecntcc){
			hospoutcasecntRatio="+"+hospoutcasecntRatioV;
		}else {
			hospoutcasecntRatio=""+hospoutcasecntRatioV;
		}
		params.put("hospoutcasecntRatio", hospoutcasecntRatio);
		double ingroupcasecnt=Double.valueOf(params.get("ingroupcasecnt_temp") + "");
		double ingroupcasecntcc=Double.valueOf(String.valueOf(hospBaseQuotaCcMap.get("INGROUP") == null ? 0 : hospBaseQuotaCcMap.get("INGROUP").toString()));
		double ingroupcasecntRatioV=imputedRatio((ingroupcasecnt-ingroupcasecntcc),ingroupcasecntcc);
		String ingroupcasecntRatio="";
		if(ingroupcasecnt>ingroupcasecntcc){
			ingroupcasecntRatio="+"+ingroupcasecntRatioV;
		}else {
			ingroupcasecntRatio=""+ingroupcasecntRatioV;
		}
		params.put("ingroupcasecntRatio", ingroupcasecntRatio);
		double oversixtycasecnt=Double.valueOf(params.get("oversixtycasecnt_temp") + "");
		double oversixtycasecntcc=Double.valueOf(String.valueOf(hospBaseQuotaCcMap.get("OVERSIXTY") == null ? 0 : hospBaseQuotaCcMap.get("OVERSIXTY").toString()));
		double oversixtycasecntRatioV=imputedRatio((oversixtycasecnt-oversixtycasecntcc),oversixtycasecntcc);
		String oversixtycasecntRatio="";
		if(oversixtycasecnt>oversixtycasecntcc){
			oversixtycasecntRatio="+"+oversixtycasecntRatioV;
		}else {
			oversixtycasecntRatio=""+oversixtycasecntRatioV;
		}
		params.put("oversixtycasecntRatio", oversixtycasecntRatio);
		double ingroupRatio=Double.valueOf(params.get("ingroupRatio") + "");
		double ingroupRatiocc=Double.valueOf(String.valueOf(hospBaseQuotaCcMap.get("GROUPRATIO") == null ? 0 : hospBaseQuotaCcMap.get("GROUPRATIO").toString()));
		double ingroupRatioRatioV=Arith.round(ingroupRatio-ingroupRatiocc,2);
		String ingroupRatioRatio="";
		if(ingroupRatio>ingroupRatiocc){
			ingroupRatioRatio="+"+ingroupRatioRatioV;
		}else {
			ingroupRatioRatio=""+ingroupRatioRatioV;
		}
		params.put("ingroupRatioRatio", ingroupRatioRatio);
		double notingrocasecnt=Double.valueOf(params.get("notingrocasecnt_temp") + "");
		double notingrocasecntcc=Double.valueOf(String.valueOf(hospBaseQuotaCcMap.get("NOTINGROUP") == null ? 0 : hospBaseQuotaCcMap.get("NOTINGROUP").toString()));
		double notingrocasecntRatioV=imputedRatio((notingrocasecnt-notingrocasecntcc),notingrocasecntcc);
		String notingrocasecntRatio="";
		if(notingrocasecnt>notingrocasecntcc){
			notingrocasecntRatio="+"+notingrocasecntRatioV;
		}else {
			notingrocasecntRatio=""+notingrocasecntRatioV;
		}
		params.put("notingrocasecntRatio", notingrocasecntRatio);
		
		//表格一中同期累计比
		double hospoutcasecntSum=Double.valueOf(String.valueOf(hospBaseQuotaSumMap.get("ALLCNT") == null ? 0 : hospBaseQuotaSumMap.get("ALLCNT").toString()));
		double hospoutcasecntSumcc=Double.valueOf(String.valueOf(hospBaseQuotaCcSumMap.get("ALLCNT") == null ? 0 : hospBaseQuotaCcSumMap.get("ALLCNT").toString()));
		double hospoutcasecntSumRatioV=imputedRatio((hospoutcasecntSum-hospoutcasecntSumcc),hospoutcasecntSumcc);
		String hospoutcasecntSumRatio="";
		if(hospoutcasecntSum>hospoutcasecntSumcc){
			hospoutcasecntSumRatio="+"+hospoutcasecntSumRatioV;
		}else {
			hospoutcasecntSumRatio=""+hospoutcasecntSumRatioV;
		}
		params.put("hospoutcasecntSumRatio", hospoutcasecntSumRatio);
		double ingroupcasecntSum=Double.valueOf(String.valueOf(hospBaseQuotaSumMap.get("INGROUP") == null ? 0 : hospBaseQuotaSumMap.get("INGROUP").toString()));
		double ingroupcasecntSumcc=Double.valueOf(String.valueOf(hospBaseQuotaCcSumMap.get("INGROUP") == null ? 0 : hospBaseQuotaCcSumMap.get("INGROUP").toString()));
		double ingroupcasecntSumRatioV=imputedRatio((ingroupcasecntSum-ingroupcasecntSumcc),ingroupcasecntSumcc);
		String ingroupcasecntSumRatio="";
		if(ingroupcasecntSum>ingroupcasecntSumcc){
			ingroupcasecntSumRatio="+"+ingroupcasecntSumRatioV;
		}else {
			ingroupcasecntSumRatio=""+ingroupcasecntSumRatioV;
		}
		params.put("ingroupcasecntSumRatio", ingroupcasecntSumRatio);
		double oversixtycasecntSum=Double.valueOf(String.valueOf(hospBaseQuotaSumMap.get("OVERSIXTY") == null ? 0 : hospBaseQuotaSumMap.get("OVERSIXTY").toString()));
		double oversixtycasecntSumcc=Double.valueOf(String.valueOf(hospBaseQuotaCcSumMap.get("OVERSIXTY") == null ? 0 : hospBaseQuotaCcSumMap.get("OVERSIXTY").toString()));
		double oversixtycasecntSumRatioV=imputedRatio((oversixtycasecntSum-oversixtycasecntSumcc),oversixtycasecntSumcc);
		String oversixtycasecntSumRatio="";
		if(oversixtycasecntSum>oversixtycasecntSumcc){
			oversixtycasecntSumRatio="+"+oversixtycasecntSumRatioV;
		}else {
			oversixtycasecntSumRatio=""+oversixtycasecntSumRatioV;
		}
		params.put("oversixtycasecntSumRatio", oversixtycasecntSumRatio);
		double ingroupRatioSum=Double.valueOf(String.valueOf(hospBaseQuotaSumMap.get("GROUPRATIO") == null ? 0 : hospBaseQuotaSumMap.get("GROUPRATIO").toString()));
		double ingroupRatioSumcc=Double.valueOf(String.valueOf(hospBaseQuotaCcSumMap.get("GROUPRATIO") == null ? 0 : hospBaseQuotaCcSumMap.get("GROUPRATIO").toString()));
		double ingroupRatioSumRatioV=Arith.round(ingroupRatioSum-ingroupRatioSumcc,2);
		String ingroupRatioSumRatio="";
		if(ingroupRatioSum>ingroupRatioSumcc){
			ingroupRatioSumRatio="+"+ingroupRatioSumRatioV;
		}else {
			ingroupRatioSumRatio=""+ingroupRatioSumRatioV;
		}
		params.put("ingroupRatioSumR", ingroupRatioSumRatio);
		double notingrocasecntSum=Double.valueOf(String.valueOf(hospBaseQuotaSumMap.get("NOTINGROUP") == null ? 0 : hospBaseQuotaSumMap.get("NOTINGROUP").toString()));
		double notingrocasecntSumcc=Double.valueOf(String.valueOf(hospBaseQuotaCcSumMap.get("NOTINGROUP") == null ? 0 : hospBaseQuotaCcSumMap.get("NOTINGROUP").toString()));
		double notingrocasecntSumRatioV=imputedRatio((notingrocasecntSum-notingrocasecntSumcc),notingrocasecntSumcc);
		String notingrocasecntSumRatio="";
		if(notingrocasecntSum>notingrocasecntSumcc){
			notingrocasecntSumRatio="+"+notingrocasecntSumRatioV;
		}else {
			notingrocasecntSumRatio=""+notingrocasecntSumRatioV;
		}
		params.put("notingrocasecntSumR", notingrocasecntSumRatio);
					
		// 表格二中出院病例数，次均费用，药占比等
		List<Map<String,Object>> hospBaseTable2StOne = analysisDRGsReportApplication.findSimpHospBaseTableTwo(dateFrom,dateTo,hospCode);
		Map<String,Object> hospBaseQuotaSttwoMap=hospBaseTable2StOne.get(0);
		params.put("hospavgfee", hospBaseQuotaSttwoMap.get("HOSPAVGFEE") == null ? 0 : Arith.dataFormat(hospBaseQuotaSttwoMap.get("HOSPAVGFEE").toString(), "3")); 
		params.put("hospavgdays", hospBaseQuotaSttwoMap.get("HOSPAVGDAYS") == null ? 0 : hospBaseQuotaSttwoMap.get("HOSPAVGDAYS").toString());
		params.put("hospdrugratio", hospBaseQuotaSttwoMap.get("HOSPDRUGRATIO") == null ? 0 : hospBaseQuotaSttwoMap.get("HOSPDRUGRATIO").toString());
		params.put("hospmaterratio", hospBaseQuotaSttwoMap.get("HOSPMATERRATIO") == null ? 0 : hospBaseQuotaSttwoMap.get("HOSPMATERRATIO").toString());
		params.put("hospdeadratio",hospBaseQuotaSttwoMap.get("HOSPDEADRATIO") == null ? 0 : hospBaseQuotaSttwoMap.get("HOSPDEADRATIO").toString());
		
		// 表格二中出院病例数，次均费用，药占比等累计值
		List<Map<String,Object>> hospBaseTable2sum = analysisDRGsReportApplication.findSimpHospBaseTableTwo(dateFromSum,dateTo,hospCode);
		Map<String,Object> hospBaseQuotaSttwosumMap=hospBaseTable2sum.get(0);
		params.put("hospavgfeesum", hospBaseQuotaSttwosumMap.get("HOSPAVGFEE") == null ? 0 : Arith.dataFormat(hospBaseQuotaSttwosumMap.get("HOSPAVGFEE").toString(), "3")); 
		params.put("hospavgdayssum", hospBaseQuotaSttwosumMap.get("HOSPAVGDAYS") == null ? 0 : hospBaseQuotaSttwosumMap.get("HOSPAVGDAYS").toString());
		params.put("hospdrugratiosum", hospBaseQuotaSttwosumMap.get("HOSPDRUGRATIO") == null ? 0 : hospBaseQuotaSttwosumMap.get("HOSPDRUGRATIO").toString());
		params.put("hospmaterratiosum", hospBaseQuotaSttwosumMap.get("HOSPMATERRATIO") == null ? 0 : hospBaseQuotaSttwosumMap.get("HOSPMATERRATIO").toString());
		params.put("hospdeadratiosum",hospBaseQuotaSttwosumMap.get("HOSPDEADRATIO") == null ? 0 : hospBaseQuotaSttwosumMap.get("HOSPDEADRATIO").toString());
	
		// 表格二中出院病例数，次均费用，药占比等同期值
		List<Map<String,Object>> hospBaseTable2StOnecc = analysisDRGsReportApplication.findSimpHospBaseTableTwo(dateFromCc,dateToCc,hospCode);
		Map<String,Object> hospBaseQuotaSttwoCcMap=hospBaseTable2StOnecc.get(0);
		params.put("hospavgfeecc", hospBaseQuotaSttwoCcMap.get("HOSPAVGFEE") == null ? 0 : Arith.dataFormat(hospBaseQuotaSttwoCcMap.get("HOSPAVGFEE").toString(), "3")); 
		params.put("hospavgdayscc", hospBaseQuotaSttwoCcMap.get("HOSPAVGDAYS") == null ? 0 : hospBaseQuotaSttwoCcMap.get("HOSPAVGDAYS").toString());
		params.put("hospdrugratiocc", hospBaseQuotaSttwoCcMap.get("HOSPDRUGRATIO") == null ? 0 : hospBaseQuotaSttwoCcMap.get("HOSPDRUGRATIO").toString());
		params.put("hospmaterratiocc", hospBaseQuotaSttwoCcMap.get("HOSPMATERRATIO") == null ? 0 : hospBaseQuotaSttwoCcMap.get("HOSPMATERRATIO").toString());
		params.put("hospdeadratiocc",hospBaseQuotaSttwoCcMap.get("HOSPDEADRATIO") == null ? 0 : hospBaseQuotaSttwoCcMap.get("HOSPDEADRATIO").toString());
		
		// 表格二中出院病例数，次均费用，药占比等同期累计值
		List<Map<String,Object>> hospBaseTable2StOneccsum = analysisDRGsReportApplication.findSimpHospBaseTableTwo(dateFromCcSum,dateToCc,hospCode);
		Map<String,Object> hospBaseQuotaSttwoCcSumMap=hospBaseTable2StOneccsum.get(0);
		params.put("hospavgfeeccsum", hospBaseQuotaSttwoCcSumMap.get("HOSPAVGFEE") == null ? 0 : Arith.dataFormat(hospBaseQuotaSttwoCcSumMap.get("HOSPAVGFEE").toString(), "3")); 
		params.put("hospavgdaysccsum", hospBaseQuotaSttwoCcSumMap.get("HOSPAVGDAYS") == null ? 0 : hospBaseQuotaSttwoCcSumMap.get("HOSPAVGDAYS").toString());
		params.put("hospdrugratioccsum", hospBaseQuotaSttwoCcSumMap.get("HOSPDRUGRATIO") == null ? 0 : hospBaseQuotaSttwoCcSumMap.get("HOSPDRUGRATIO").toString());
		params.put("hospmaterratioccsum", hospBaseQuotaSttwoCcSumMap.get("HOSPMATERRATIO") == null ? 0 : hospBaseQuotaSttwoCcSumMap.get("HOSPMATERRATIO").toString());
		params.put("hospdeadratioccsum",hospBaseQuotaSttwoCcSumMap.get("HOSPDEADRATIO") == null ? 0 : hospBaseQuotaSttwoCcSumMap.get("HOSPDEADRATIO").toString());
		
		//表格二中同期比
		double hospavgfee=Double.valueOf(String.valueOf(hospBaseQuotaSttwoMap.get("HOSPAVGFEE") == null ? 0 : hospBaseQuotaSttwoMap.get("HOSPAVGFEE").toString()));
		double hospavgfeecc=Double.valueOf(String.valueOf(hospBaseQuotaSttwoCcMap.get("HOSPAVGFEE") == null ? 0 : hospBaseQuotaSttwoCcMap.get("HOSPAVGFEE").toString()));
		double hospavgfeeRatioV=imputedRatio((hospavgfee-hospavgfeecc),hospavgfeecc);
		String hospavgfeeRatio="";
		if(hospavgfee>hospavgfeecc){
			hospavgfeeRatio="+"+hospavgfeeRatioV;
		}else {
			hospavgfeeRatio=""+hospavgfeeRatioV;
		}
		params.put("hospavgfeeRatio", hospavgfeeRatio);
		double hospavgdays=Double.valueOf(String.valueOf(hospBaseQuotaSttwoMap.get("HOSPAVGDAYS") == null ? 0 : hospBaseQuotaSttwoMap.get("HOSPAVGDAYS").toString()));
		double hospavgdayscc=Double.valueOf(String.valueOf(hospBaseQuotaSttwoCcMap.get("HOSPAVGDAYS") == null ? 0 : hospBaseQuotaSttwoCcMap.get("HOSPAVGDAYS").toString()));
		double hospavgdaysRatioV=imputedRatio((hospavgdays-hospavgdayscc),hospavgdayscc);
		String hospavgdaysRatio="";
		if(hospavgdays>hospavgdayscc){
			hospavgdaysRatio="+"+hospavgdaysRatioV;
		}else {
			hospavgdaysRatio=""+hospavgdaysRatioV;
		}
		params.put("hospavgdaysRatio", hospavgdaysRatio);
		double hospdrugratio=Double.valueOf(String.valueOf(hospBaseQuotaSttwoMap.get("HOSPDRUGRATIO") == null ? 0 : hospBaseQuotaSttwoMap.get("HOSPDRUGRATIO").toString()));
		double hospdrugratiocc=Double.valueOf(String.valueOf(hospBaseQuotaSttwoCcMap.get("HOSPDRUGRATIO") == null ? 0 : hospBaseQuotaSttwoCcMap.get("HOSPDRUGRATIO").toString()));
		double hospdrugratioRatioV=Arith.round(hospdrugratio-hospdrugratiocc,2);
		String hospdrugratioRatio="";
		if(hospdrugratio>hospdrugratiocc){
			hospdrugratioRatio="+"+hospdrugratioRatioV;
		}else {
			hospdrugratioRatio=""+hospdrugratioRatioV;
		}
		params.put("hospdrugratioRatio", hospdrugratioRatio);
		double hospmaterratio=Double.valueOf(String.valueOf(hospBaseQuotaSttwoMap.get("HOSPMATERRATIO") == null ? 0 : hospBaseQuotaSttwoMap.get("HOSPMATERRATIO").toString()));
		double hospmaterratiocc=Double.valueOf(String.valueOf(hospBaseQuotaSttwoCcMap.get("HOSPMATERRATIO") == null ? 0 : hospBaseQuotaSttwoCcMap.get("HOSPMATERRATIO").toString()));
		double hospmaterratioRatioV=Arith.round(hospmaterratio-hospmaterratiocc,2);
		String hospmaterratioRatio="";
		if(hospmaterratio>hospmaterratiocc){
			hospmaterratioRatio="+"+hospmaterratioRatioV;
		}else {
			hospmaterratioRatio=""+hospmaterratioRatioV;
		}
		params.put("hospmaterratioRatio", hospmaterratioRatio);
		double hospdeadratio=Double.valueOf(String.valueOf(hospBaseQuotaSttwoMap.get("HOSPDEADRATIO") == null ? 0 : hospBaseQuotaSttwoMap.get("HOSPDEADRATIO").toString()));
		double hospdeadratiocc=Double.valueOf(String.valueOf(hospBaseQuotaSttwoCcMap.get("HOSPDEADRATIO") == null ? 0 : hospBaseQuotaSttwoCcMap.get("HOSPDEADRATIO").toString()));
		double hospdeadratioRatioV=Arith.round(hospdeadratio-hospdeadratiocc,2);
		String hospdeadratioRatio="";
		if(hospdeadratio>hospdeadratiocc){
			hospdeadratioRatio="+"+hospdeadratioRatioV;
		}else {
			hospdeadratioRatio=""+hospdeadratioRatioV;
		}
		params.put("hospdeadratioRatio", hospdeadratioRatio);
		
		//表格二中同期累计比
		double hospavgfeeSum=Double.valueOf(String.valueOf(hospBaseQuotaSttwosumMap.get("HOSPAVGFEE") == null ? 0 : hospBaseQuotaSttwosumMap.get("HOSPAVGFEE").toString()));
		double hospavgfeeSumcc=Double.valueOf(String.valueOf(hospBaseQuotaSttwoCcSumMap.get("HOSPAVGFEE") == null ? 0 : hospBaseQuotaSttwoCcSumMap.get("HOSPAVGFEE").toString()));
		double hospavgfeeSumRatioV=imputedRatio((hospavgfeeSum-hospavgfeeSumcc),hospavgfeeSumcc);
		String hospavgfeeSumRatio="";
		if(hospavgfeeSum>hospavgfeeSumcc){
			hospavgfeeSumRatio="+"+hospavgfeeSumRatioV;
		}else {
			hospavgfeeSumRatio=""+hospavgfeeSumRatioV;
		}
		params.put("hospavgfeeSumRatio", hospavgfeeSumRatio);
		double hospavgdaysSum=Double.valueOf(String.valueOf(hospBaseQuotaSttwosumMap.get("HOSPAVGDAYS") == null ? 0 : hospBaseQuotaSttwosumMap.get("HOSPAVGDAYS").toString()));
		double hospavgdaysSumcc=Double.valueOf(String.valueOf(hospBaseQuotaSttwoCcSumMap.get("HOSPAVGDAYS") == null ? 0 : hospBaseQuotaSttwoCcSumMap.get("HOSPAVGDAYS").toString()));
		double hospavgdaysSumRatioV=imputedRatio((hospavgdaysSum-hospavgdaysSumcc),hospavgdaysSumcc);
		String hospavgdaysSumRatio="";
		if(hospavgdaysSum>hospavgdaysSumcc){
			hospavgdaysSumRatio="+"+hospavgdaysSumRatioV;
		}else {
			hospavgdaysSumRatio=""+hospavgdaysSumRatioV;
		}
		params.put("hospavgdaysSumRatio", hospavgdaysSumRatio);
		double hospdrugratioSum=Double.valueOf(String.valueOf(hospBaseQuotaSttwosumMap.get("HOSPDRUGRATIO") == null ? 0 : hospBaseQuotaSttwosumMap.get("HOSPDRUGRATIO").toString()));
		double hospdrugratioSumcc=Double.valueOf(String.valueOf(hospBaseQuotaSttwoCcSumMap.get("HOSPDRUGRATIO") == null ? 0 : hospBaseQuotaSttwoCcSumMap.get("HOSPDRUGRATIO").toString()));
		double hospdrugratioSumRatioV=Arith.round(hospdrugratioSum-hospdrugratioSumcc,2);
		String hospdrugratioSumRatio="";
		if(hospdrugratioSum>hospdrugratioSumcc){
			hospdrugratioSumRatio="+"+hospdrugratioSumRatioV;
		}else {
			hospdrugratioSumRatio=""+hospdrugratioSumRatioV;
		}
		params.put("hospdrugratioSumRatio", hospdrugratioSumRatio);
		double hospmaterratioSum=Double.valueOf(String.valueOf(hospBaseQuotaSttwosumMap.get("HOSPMATERRATIO") == null ? 0 : hospBaseQuotaSttwosumMap.get("HOSPMATERRATIO").toString()));
		double hospmaterratioSumcc=Double.valueOf(String.valueOf(hospBaseQuotaSttwoCcSumMap.get("HOSPMATERRATIO") == null ? 0 : hospBaseQuotaSttwoCcSumMap.get("HOSPMATERRATIO").toString()));
		double hospmaterratioSumRatioV=Arith.round(hospmaterratioSum-hospmaterratioSumcc,2);
		String hospmaterratioSumRatio="";
		if(hospmaterratioSum>hospmaterratioSumcc){
			hospmaterratioSumRatio="+"+hospmaterratioSumRatioV;
		}else {
			hospmaterratioSumRatio=""+hospmaterratioSumRatioV;
		}
		params.put("hospmaterratioSumR", hospmaterratioSumRatio);
		double hospdeadratioSum=Double.valueOf(String.valueOf(hospBaseQuotaSttwosumMap.get("HOSPDEADRATIO") == null ? 0 : hospBaseQuotaSttwosumMap.get("HOSPDEADRATIO").toString()));
		double hospdeadratioSumcc=Double.valueOf(String.valueOf(hospBaseQuotaSttwoCcSumMap.get("HOSPDEADRATIO") == null ? 0 : hospBaseQuotaSttwoCcSumMap.get("HOSPDEADRATIO").toString()));
		double hospdeadratioSumRatioV=Arith.round(hospdeadratioSum-hospdeadratioSumcc,2);
		String hospdeadratioSumRatio="";
		if(hospdeadratioSum>hospdeadratioSumcc){
			hospdeadratioSumRatio="+"+hospdeadratioSumRatioV;
		}else {
			hospdeadratioSumRatio=""+hospdeadratioSumRatioV;
		}
		params.put("hospdeadratioSumR", hospdeadratioSumRatio);	
		// 表格三中cmi，时间消耗指数，费用消耗指数，drg组数,总权重等
		String benchmarkYear=drgsIndexCalFacade.getStdID(dateFrom,dateTo);
//		String benchmarkYear=dto.get("benchmarkYear")==null?"":dto.get("benchmarkYear").toString();  //标杆年份
		List<Map<String,Object>> hospObjThree = analysisDRGsReportApplication.findSimpHospBaseTableThree(drgVersion,dateFrom,dateTo,benchmarkYear,hospCode);
		Map<String,Object> hospObjThreeMap=hospObjThree.get(0);
		params.put("hdcnt", hospObjThreeMap.get("HOSPDRGCNT")==null?0:hospObjThreeMap.get("HOSPDRGCNT"));
		params.put("hcmi", hospObjThreeMap.get("HOSPCMI")==null?0:hospObjThreeMap.get("HOSPCMI"));
		params.put("htwt",  hospObjThreeMap.get("HOSPTOTALWEIGHT")==null?0: Arith.dataFormat(hospObjThreeMap.get("HOSPTOTALWEIGHT").toString(), "3")); 
		params.put("hefee",  hospObjThreeMap.get("HOSPEFFEE")==null?0:hospObjThreeMap.get("HOSPEFFEE"));
		params.put("htfee",  hospObjThreeMap.get("HOSPTIMEFEE")==null?0:hospObjThreeMap.get("HOSPTIMEFEE"));
		params.put("driAratio",  hospObjThreeMap.get("DEADRISKARATIO")==null?0:hospObjThreeMap.get("DEADRISKARATIO"));
		
		// 表格三中cmi，时间消耗指数，费用消耗指数，drg组数,总权重等累计值
		List<Map<String,Object>> hospObjThreeSum = analysisDRGsReportApplication.findSimpHospBaseTableThree(drgVersion,dateFromSum,dateTo,benchmarkYear,hospCode);
		Map<String,Object> hospObjThreeSumMap=hospObjThreeSum.get(0);
		params.put("hdcntsum", hospObjThreeSumMap.get("HOSPDRGCNT")==null?0:hospObjThreeSumMap.get("HOSPDRGCNT"));
		params.put("hcmisum", hospObjThreeSumMap.get("HOSPCMI")==null?0:hospObjThreeSumMap.get("HOSPCMI"));
		params.put("htwtsum",  hospObjThreeSumMap.get("HOSPTOTALWEIGHT")==null?0: Arith.dataFormat(hospObjThreeSumMap.get("HOSPTOTALWEIGHT").toString(), "3")); 
		params.put("hefeesum",  hospObjThreeSumMap.get("HOSPEFFEE")==null?0:hospObjThreeSumMap.get("HOSPEFFEE"));
		params.put("htfeesum",  hospObjThreeSumMap.get("HOSPTIMEFEE")==null?0:hospObjThreeSumMap.get("HOSPTIMEFEE"));
		params.put("driAratiosum",  hospObjThreeSumMap.get("DEADRISKARATIO")==null?0:hospObjThreeSumMap.get("DEADRISKARATIO"));
		
		// 表格三中cmi，时间消耗指数，费用消耗指数，drg组数,总权重等同期值
		List<Map<String,Object>> hospObjThreeCc = analysisDRGsReportApplication.findSimpHospBaseTableThree(drgVersion,dateFromCc,dateToCc,benchmarkYear,hospCode);
		Map<String,Object> hospObjThreeCcMap=hospObjThreeCc.get(0);
		params.put("hdcntcc", hospObjThreeCcMap.get("HOSPDRGCNT")==null?0:hospObjThreeCcMap.get("HOSPDRGCNT"));
		params.put("hcmicc", hospObjThreeCcMap.get("HOSPCMI")==null?0:hospObjThreeCcMap.get("HOSPCMI"));
		params.put("htwtcc",  hospObjThreeCcMap.get("HOSPTOTALWEIGHT")==null?0: Arith.dataFormat(hospObjThreeCcMap.get("HOSPTOTALWEIGHT").toString(), "3")); 
		params.put("hefeecc",  hospObjThreeCcMap.get("HOSPEFFEE")==null?0:hospObjThreeCcMap.get("HOSPEFFEE"));
		params.put("htfeecc",  hospObjThreeCcMap.get("HOSPTIMEFEE")==null?0:hospObjThreeCcMap.get("HOSPTIMEFEE"));
		params.put("driAratiocc",  hospObjThreeCcMap.get("DEADRISKARATIO")==null?0:hospObjThreeCcMap.get("DEADRISKARATIO"));
		
		// 表格三中cmi，时间消耗指数，费用消耗指数，drg组数,总权重等同期累计
		List<Map<String,Object>> hospObjThreeCcSum = analysisDRGsReportApplication.findSimpHospBaseTableThree(drgVersion,dateFromCcSum,dateToCc,benchmarkYear,hospCode);
		Map<String,Object> hospObjThreeCcSumMap=hospObjThreeCcSum.get(0);
		params.put("hdcntccsum", hospObjThreeCcSumMap.get("HOSPDRGCNT")==null?0:hospObjThreeCcSumMap.get("HOSPDRGCNT"));
		params.put("hcmiccsum", hospObjThreeCcSumMap.get("HOSPCMI")==null?0:hospObjThreeCcSumMap.get("HOSPCMI"));
		params.put("htwtccsum",  hospObjThreeCcSumMap.get("HOSPTOTALWEIGHT")==null?0: Arith.dataFormat(hospObjThreeCcSumMap.get("HOSPTOTALWEIGHT").toString(), "3")); 
		params.put("hefeeccsum",  hospObjThreeCcSumMap.get("HOSPEFFEE")==null?0:hospObjThreeCcSumMap.get("HOSPEFFEE"));
		params.put("htfeeccsum",  hospObjThreeCcSumMap.get("HOSPTIMEFEE")==null?0:hospObjThreeCcSumMap.get("HOSPTIMEFEE"));
		params.put("driAratioccsum",  hospObjThreeCcSumMap.get("DEADRISKARATIO")==null?0:hospObjThreeCcSumMap.get("DEADRISKARATIO"));
		
		//表格三中同期比
		double hdcnt=Double.valueOf(String.valueOf(hospObjThreeMap.get("HOSPDRGCNT") == null ? 0 : hospObjThreeMap.get("HOSPDRGCNT").toString()));
		double hdcntcc=Double.valueOf(String.valueOf(hospObjThreeCcMap.get("HOSPDRGCNT") == null ? 0 : hospObjThreeCcMap.get("HOSPDRGCNT").toString()));
		double hdcntRatioV=imputedRatio((hdcnt-hdcntcc),hdcntcc);
		String hdcntRatio="";
		if(hdcnt>hdcntcc){
			hdcntRatio="+"+hdcntRatioV;
		}else {
			hdcntRatio=""+hdcntRatioV;
		}
		params.put("hdcntRatio", hdcntRatio);
		double hcmi=Double.valueOf(String.valueOf(hospObjThreeMap.get("HOSPCMI") == null ? 0 : hospObjThreeMap.get("HOSPCMI").toString()));
		double hcmicc=Double.valueOf(String.valueOf(hospObjThreeCcMap.get("HOSPCMI") == null ? 0 : hospObjThreeCcMap.get("HOSPCMI").toString()));
		double hcmiRatioV=imputedRatio((hcmi-hcmicc),hcmicc);
		String hcmiRatio="";
		if(hcmi>hcmicc){
			hcmiRatio="+"+hcmiRatioV;
		}else {
			hcmiRatio=""+hcmiRatioV;
		}
		params.put("hcmiRatio", hcmiRatio);
		double htwt=Double.valueOf(String.valueOf(hospObjThreeMap.get("HOSPTOTALWEIGHT") == null ? 0 : hospObjThreeMap.get("HOSPTOTALWEIGHT").toString()));
		double htwtcc=Double.valueOf(String.valueOf(hospObjThreeCcMap.get("HOSPTOTALWEIGHT") == null ? 0 : hospObjThreeCcMap.get("HOSPTOTALWEIGHT").toString()));
		double htwtRatioV=imputedRatio((htwt-htwtcc),htwtcc);
		String htwtRatio="";
		if(htwt>htwtcc){
			htwtRatio="+"+htwtRatioV;
		}else {
			htwtRatio=""+htwtRatioV;
		}
		params.put("htwtRatio", htwtRatio);
		double hefee=Double.valueOf(String.valueOf(hospObjThreeMap.get("HOSPEFFEE") == null ? 0 : hospObjThreeMap.get("HOSPEFFEE").toString()));
		double hefeecc=Double.valueOf(String.valueOf(hospObjThreeCcMap.get("HOSPEFFEE") == null ? 0 : hospObjThreeCcMap.get("HOSPEFFEE").toString()));
		double hefeeRatioV=imputedRatio((hefee-hefeecc),hefeecc);
		String hefeeRatio="";
		if(hefee>hefeecc){
			hefeeRatio="+"+hefeeRatioV;
		}else {
			hefeeRatio=""+hefeeRatioV;
		}
		params.put("hefeeRatio", hefeeRatio);
		double htfee=Double.valueOf(String.valueOf(hospObjThreeMap.get("HOSPTIMEFEE") == null ? 0 : hospObjThreeMap.get("HOSPTIMEFEE").toString()));
		double htfeecc=Double.valueOf(String.valueOf(hospObjThreeCcMap.get("HOSPTIMEFEE") == null ? 0 : hospObjThreeCcMap.get("HOSPTIMEFEE").toString()));
		double htfeeRatioV=imputedRatio((htfee-htfeecc),htfeecc);
		String htfeeRatio="";
		if(htfee>htfeecc){
			htfeeRatio="+"+htfeeRatioV;
		}else {
			htfeeRatio=""+htfeeRatioV;
		}
		params.put("htfeeRatio", htfeeRatio);
		double driAratio=Double.valueOf(String.valueOf(hospObjThreeMap.get("DEADRISKARATIO") == null ? 0 : hospObjThreeMap.get("DEADRISKARATIO").toString()));
		double driAratiocc=Double.valueOf(String.valueOf(hospObjThreeCcMap.get("DEADRISKARATIO") == null ? 0 : hospObjThreeCcMap.get("DEADRISKARATIO").toString()));
		double driAratioRatioV=Arith.round(driAratio-driAratiocc,2);
		String driAratioRatio="";
		if(driAratio>driAratiocc){
			driAratioRatio="+"+driAratioRatioV;
		}else {
			driAratioRatio=""+driAratioRatioV;
		}
		params.put("driAratioRatio", driAratioRatio);
		
		//表格三中同期累计比
		double hdcntSum=Double.valueOf(String.valueOf(hospObjThreeSumMap.get("HOSPDRGCNT") == null ? 0 : hospObjThreeSumMap.get("HOSPDRGCNT").toString()));
		double hdcntSumcc=Double.valueOf(String.valueOf(hospObjThreeCcSumMap.get("HOSPDRGCNT") == null ? 0 : hospObjThreeCcSumMap.get("HOSPDRGCNT").toString()));
		double hdcntSumRatioV=imputedRatio((hdcntSum-hdcntSumcc),hdcntSumcc);
		String hdcntSumRatio="";
		if(hdcntSum>hdcntSumcc){
			hdcntSumRatio="+"+hdcntSumRatioV;
		}else {
			hdcntSumRatio=""+hdcntSumRatioV;
		}
		params.put("hdcntSumRatio", hdcntSumRatio);
		double hcmiSum=Double.valueOf(String.valueOf(hospObjThreeSumMap.get("HOSPCMI") == null ? 0 : hospObjThreeSumMap.get("HOSPCMI").toString()));
		double hcmiSumcc=Double.valueOf(String.valueOf(hospObjThreeCcSumMap.get("HOSPCMI") == null ? 0 : hospObjThreeCcSumMap.get("HOSPCMI").toString()));
		double hcmiSumRatioV=imputedRatio((hcmiSum-hcmiSumcc),hcmiSumcc);
		String hcmiSumRatio="";
		if(hcmiSum>hcmiSumcc){
			hcmiSumRatio="+"+hcmiSumRatioV;
		}else {
			hcmiSumRatio=""+hcmiSumRatioV;
		}
		params.put("hcmiSumRatio", hcmiSumRatio);
		double htwtSum=Double.valueOf(String.valueOf(hospObjThreeSumMap.get("HOSPTOTALWEIGHT") == null ? 0 : hospObjThreeSumMap.get("HOSPTOTALWEIGHT").toString()));
		double htwtSumcc=Double.valueOf(String.valueOf(hospObjThreeCcSumMap.get("HOSPTOTALWEIGHT") == null ? 0 : hospObjThreeCcSumMap.get("HOSPTOTALWEIGHT").toString()));
		double htwtSumRatioV=imputedRatio((htwtSum-htwtSumcc),htwtSumcc);
		String htwtSumRatio="";
		if(htwtSum>htwtSumcc){
			htwtSumRatio="+"+htwtSumRatioV;
		}else {
			htwtSumRatio=""+htwtSumRatioV;
		}
		params.put("htwtSumRatio", htwtSumRatio);
		double hefeeSum=Double.valueOf(String.valueOf(hospObjThreeSumMap.get("HOSPEFFEE") == null ? 0 : hospObjThreeSumMap.get("HOSPEFFEE").toString()));
		double hefeeSumcc=Double.valueOf(String.valueOf(hospObjThreeCcSumMap.get("HOSPEFFEE") == null ? 0 : hospObjThreeCcSumMap.get("HOSPEFFEE").toString()));
		double hefeeSumRatioV=imputedRatio((hefeeSum-hefeeSumcc),hefeeSumcc);
		String hefeeSumRatio="";
		if(hefeeSum>hefeeSumcc){
			hefeeSumRatio="+"+hefeeSumRatioV;
		}else {
			hefeeSumRatio=""+hefeeSumRatioV;
		}
		params.put("hefeeSumR", hefeeSumRatio);
		double htfeeSum=Double.valueOf(String.valueOf(hospObjThreeSumMap.get("HOSPTIMEFEE") == null ? 0 : hospObjThreeSumMap.get("HOSPTIMEFEE").toString()));
		double htfeeSumcc=Double.valueOf(String.valueOf(hospObjThreeCcSumMap.get("HOSPTIMEFEE") == null ? 0 : hospObjThreeCcSumMap.get("HOSPTIMEFEE").toString()));
		double htfeeSumRatioV=imputedRatio((htfeeSum-htfeeSumcc),htfeeSumcc);
		String htfeeSumRatio="";
		if(htfeeSum>htfeeSumcc){
			htfeeSumRatio="+"+htfeeSumRatioV;
		}else {
			htfeeSumRatio=""+htfeeSumRatioV;
		}
		params.put("htfeeSumR", htfeeSumRatio);
		double driAratioSum=Double.valueOf(String.valueOf(hospObjThreeSumMap.get("DEADRISKARATIO") == null ? 0 : hospObjThreeSumMap.get("DEADRISKARATIO").toString()));
		double driAratioSumcc=Double.valueOf(String.valueOf(hospObjThreeCcSumMap.get("DEADRISKARATIO") == null ? 0 : hospObjThreeCcSumMap.get("DEADRISKARATIO").toString()));
		double driAratioSumRatioV=Arith.round(driAratioSum-driAratioSumcc,2);
		String driAratioSumRatio="";
		if(driAratioSum>driAratioSumcc){
			driAratioSumRatio="+"+driAratioSumRatioV;
		}else {
			driAratioSumRatio=""+driAratioSumRatioV;
		}
		params.put("driAratioSumR", driAratioSumRatio);	
	}
	
	    //加载第二个章节信息
		public void loadARTwoSection(Map<String, Object> dto, Map<String, Object> paramMap) throws IOException{
			
			// 获取手术病例
			String caseOperCount = analysisDRGsReportApplication.findHospCaseOperationCount(paramMap);
			params.put("caseOperCount_temp", Integer.parseInt(caseOperCount+""));
			params.put("caseOperCount", Arith.dataFormat(caseOperCount+"", "2"));
			String operRation="0";
			int operCnt = Integer.parseInt(caseOperCount);
			int noOperCnt = 0;
			if(params.get("hospoutcasecnt_temp")!="0"){
				 operRation = (Arith.mul(Arith.div(Double.valueOf(caseOperCount), Double.valueOf(params.get("hospoutcasecnt_temp") + ""), 4), 100))+"%";
				 //非手术病例数，参与图1饼图绘制
				 noOperCnt = Integer.parseInt(params.get("hospoutcasecnt_temp") + "")-Integer.parseInt(caseOperCount);
				 allMap.put("noOperCnt",noOperCnt);
				 allMap.put("operCnt", operCnt);
			}else{
				operRation="0";
			}
			//手术占比
			params.put("operRation", operRation);
			
			// 获取手术级别
			List<Map<String,Object>> oplevelList = analysisDRGsReportApplication.findOperCaseByLvel(paramMap);
			String mostlevelname = "--";
			int levOneCnt = 0;
			int levTwoCnt = 0;
			int levThreeCnt = 0;
			int levFourCnt = 0;
			int levOtherCnt = 0;
			int mostlevelcnt = 0;
			int drgLevOneCnt = 0;
			int drgLevTwoCnt = 0;
			int drgLevThreeCnt = 0;
			int drgLevFourCnt = 0;
			int drgLevOtherCnt = 0;
			int noDrgLevOneCnt = 0;
			int noDrgLevTwoCnt = 0;
			int noDrgLevThreeCnt = 0;
			int noDrgLevFourCnt = 0;
			int noDrgLevOtherCnt = 0;
			double cmiOne = 0;
			double cmiTwo = 0;
			double cmiThree = 0;
			double cmiFour = 0;
			double cmiOther = 0;
			double weightOne = 0.00;
			double weightTwo = 0.00;
			double weightThree = 0.00;
			double weightFour = 0.00;
			double weightOther = 0.00;
			if (oplevelList.size() > 0) {
				for (int i = 0; i < oplevelList.size(); i++) {
					Map<String,Object> obj = oplevelList.get(i);
					String level = obj.get("OPERCASELEVEL") == null ? "--" : (obj.get("OPERCASELEVEL") + "").trim();
					int levelcnt = obj.get("OPERCASECNT") == null ? 0 : Double.valueOf(obj.get("OPERCASECNT") + "").intValue();
					int drglevelcnt = obj.get("DRGOPERCNT") == null ? 0 : Double.valueOf(obj.get("DRGOPERCNT") + "").intValue();
					int nodrglevelcnt = obj.get("NODRGOPERCNT") == null ? 0 : Double.valueOf(obj.get("NODRGOPERCNT") + "").intValue();
					double cmi=obj.get("CMI")==null?0:Double.valueOf(obj.get("CMI").toString());
					double asweight=obj.get("AS_WEIGHT")==null?0:Double.valueOf(obj.get("AS_WEIGHT").toString());
					if (i == 0) {
						if (level.equals("1")) {
							levOneCnt = levelcnt;
							mostlevelcnt = levelcnt;
							mostlevelname = "一级";
							drgLevOneCnt = drglevelcnt;
							noDrgLevOneCnt = nodrglevelcnt;
							cmiOne = cmi;
							weightOne = asweight;
							
						} else if (level.equals("2")) {
							levTwoCnt = levelcnt;
							mostlevelcnt = levelcnt;
							mostlevelname = "二级";
							drgLevTwoCnt = drglevelcnt;
							noDrgLevTwoCnt = nodrglevelcnt;
							cmiTwo = cmi;
							weightTwo = asweight;
						} else if (level.equals("3")) {
							levThreeCnt = levelcnt;
							mostlevelcnt = levelcnt;
							mostlevelname = "三级";
							drgLevThreeCnt = drglevelcnt;
							noDrgLevThreeCnt = nodrglevelcnt;
							cmiThree = cmi;
							weightThree = asweight;
						} else if (level.equals("4")) {
							levFourCnt = levelcnt;
							mostlevelcnt = levelcnt;
							mostlevelname = "四级";
							drgLevFourCnt = drglevelcnt;
							noDrgLevFourCnt = nodrglevelcnt;
							cmiFour = cmi;
							weightFour = asweight;
						} else {
							levOtherCnt = levelcnt;
							mostlevelcnt = levelcnt;
							mostlevelname = "其他";
							drgLevOtherCnt = drglevelcnt;
							noDrgLevOtherCnt = nodrglevelcnt;
							cmiOther = cmi;
							weightOther = asweight;
						}
					} else {
						if (level.equals("1")) {
							levOneCnt = levelcnt;
							drgLevOneCnt = drglevelcnt;
							noDrgLevOneCnt = nodrglevelcnt;
							cmiOne = cmi;
							weightOne = asweight;
						} else if (level.equals("2")) {
							levTwoCnt = levelcnt;
							drgLevTwoCnt = drglevelcnt;
							noDrgLevTwoCnt = nodrglevelcnt;
							cmiTwo = cmi;
							weightTwo = asweight;
						} else if (level.equals("3")) {
							levThreeCnt = levelcnt;
							drgLevThreeCnt = drglevelcnt;
							noDrgLevThreeCnt = nodrglevelcnt;
							cmiThree = cmi;
							weightThree = asweight;
						} else if (level.equals("4")) {
							levFourCnt = levelcnt;
							drgLevFourCnt = drglevelcnt;
							noDrgLevFourCnt = nodrglevelcnt;
							cmiFour = cmi;
							weightFour = asweight;
						} else {
							levOtherCnt = levelcnt;
							drgLevOtherCnt = drglevelcnt;
							noDrgLevOtherCnt = nodrglevelcnt;
							cmiOther = cmi;
							weightOther = asweight;
						}
					}
				}
			}
			
			int levAll=levOneCnt+levTwoCnt+levThreeCnt+levFourCnt+levOtherCnt;
			int drgLevAll=drgLevOneCnt+drgLevTwoCnt+drgLevThreeCnt+drgLevFourCnt+drgLevOtherCnt;
			int noDrgLevAll=noDrgLevOneCnt+noDrgLevTwoCnt+noDrgLevThreeCnt+noDrgLevFourCnt+noDrgLevOtherCnt;
			double weightAll=weightOne+weightTwo+weightThree+weightFour+weightOther;

			//手术例数最多的级别名称
			params.put("mostLevelName", mostlevelname);
			
			//将值传回前台展示图片
			allMap.put("levOne",levOneCnt);
			allMap.put("levTwo", levTwoCnt);
			allMap.put("levThree", levThreeCnt);
			allMap.put("levFour", levFourCnt);
			allMap.put("levOther", levOtherCnt);
			
			//表格6——填充数据
			//各级别出院病例数格式化处理数据
			params.put("levOneT",Arith.dataFormat(levOneCnt+"", "2"));
			params.put("levTwoT", Arith.dataFormat(levTwoCnt+"", "2"));
			params.put("levThreeT", Arith.dataFormat(levThreeCnt+"", "2"));
			params.put("levFourT", Arith.dataFormat(levFourCnt+"", "2"));
			params.put("levOtherT", Arith.dataFormat(levOtherCnt+"", "2"));
			params.put("levAllT", Arith.dataFormat(levAll+"", "2"));//主要手术病例数合计
			//各级别入组病例数格式化处理数据
			params.put("drgLevOneT",Arith.dataFormat(drgLevOneCnt+"", "2"));
			params.put("drgLevTwoT", Arith.dataFormat(drgLevTwoCnt+"", "2"));
			params.put("drgLevThreeT", Arith.dataFormat(drgLevThreeCnt+"", "2"));
			params.put("drgLevFourT", Arith.dataFormat(drgLevFourCnt+"", "2"));
			params.put("drgLevOtherT", Arith.dataFormat(drgLevOtherCnt+"", "2"));
			params.put("drgLevAllT", Arith.dataFormat(drgLevAll+"", "2"));
			//各级别未入组病例数格式化处理数据
			params.put("noDrgLevOneT",Arith.dataFormat(noDrgLevOneCnt+"", "2"));
			params.put("noDrgLevTwoT", Arith.dataFormat(noDrgLevTwoCnt+"", "2"));
			params.put("noDrgLevThreeT", Arith.dataFormat(noDrgLevThreeCnt+"", "2"));
			params.put("noDrgLevFourT", Arith.dataFormat(noDrgLevFourCnt+"", "2"));
			params.put("noDrgLevOtherT", Arith.dataFormat(noDrgLevOtherCnt+"", "2"));
			params.put("noDrgLevAllT", Arith.dataFormat(noDrgLevAll+"", "2"));
			//各级别CMI格式化处理数据
			params.put("cmiOne",Arith.dataFormat(cmiOne+"", "1"));
			params.put("cmiTwo", Arith.dataFormat(cmiTwo+"", "1"));
			params.put("cmiThree", Arith.dataFormat(cmiThree+"", "1"));
			params.put("cmiFour", Arith.dataFormat(cmiFour+"", "1"));
			params.put("cmiOther", Arith.dataFormat(cmiOther+"", "1"));
			params.put("cmiAll", imputedRatio(Double.valueOf(weightAll)/100,Double.valueOf(drgLevAll)));//所有手术病例CMI
			
			//各级手术比例
			params.put("levOneR",imputedRatio(Double.valueOf(levOneCnt),Double.valueOf(levAll)));
			params.put("levTwoR", imputedRatio(Double.valueOf(levTwoCnt),Double.valueOf(levAll)));
			params.put("levThreeR", imputedRatio(Double.valueOf(levThreeCnt),Double.valueOf(levAll)));
			params.put("levFourR", imputedRatio(Double.valueOf(levFourCnt),Double.valueOf(levAll)));
			params.put("levOtherR", imputedRatio(Double.valueOf(levOtherCnt),Double.valueOf(levAll)));
			params.put("mostLevelR", imputedRatio(Double.valueOf(mostlevelcnt),Double.valueOf(levAll)));
			
			// 手术种类个数
			String findOperTypeCnt = analysisDRGsReportApplication.findOperTypeCnt(paramMap);
			params.put("operTypeCnt", Arith.dataFormat(findOperTypeCnt+"", "2"));

			//2.2章表格7各科室频次最高的三种手术情况
			resultListSeven=new ArrayList<List<String>>();
			List<Map<String,Object>> topDepOperList=new ArrayList<Map<String,Object>>();
			List<String> topOperARList=new ArrayList<>();
			List<Map<String,Object>> findDepMainOperInfoList = analysisDRGsReportApplication.findDepMainOperInfo(paramMap);
			List<String> depMainOperInfoList =new ArrayList<String>();
			if(depMainOperInfoList.size()<1){
				depMainOperInfoList =new ArrayList<String>();
				depMainOperInfoList.add("-");
				depMainOperInfoList.add("-");
				depMainOperInfoList.add("-");
				depMainOperInfoList.add("-");
				depMainOperInfoList.add("-");
				resultListSeven.add(depMainOperInfoList);
			}else {						
				for (int m = 0; m < findDepMainOperInfoList.size(); m++) {
					Map<String,Object> depobj = findDepMainOperInfoList.get(m);
					String operdepCode = depobj.get("DEPCODE") == null ? "" : depobj.get("DEPCODE").toString().trim(); //手术级别
					String operdepName = depobj.get("DEPNAME") == null ? "" : depobj.get("DEPNAME").toString().trim(); //手术个数
					int depOperCnt = depobj.get("OPERCNT") == null ? 0 : Double.valueOf(depobj.get("OPERCNT") + "").intValue();//科室手术例数
					if (m == 0) { 
						String operdepNameFirst = operdepName;
						params.put("operdepNameFirst", operdepNameFirst);
					}else if (m == 1){
						String operdepNameTwo = operdepName;
						params.put("operdepNameTwo", operdepNameTwo);
					}
					int lev=1;
					topDepOperList=new ArrayList<Map<String,Object>>();
					topDepOperList = analysisDRGsReportApplication.findtopOperCaseByDep(paramMap,operdepCode);
					if(!topDepOperList.isEmpty()){
						for(Map<String,Object> obj :topDepOperList){
							if(lev < 4){
							String objdepName=obj.get("DEPNAME") == null ? "" : obj.get("DEPNAME").toString().trim();
							String objDESC=obj.get("DECC") == null ? "" : obj.get("DECC").toString().trim();
							String objCNT=obj.get("CNT") == null ? "0" : obj.get("CNT").toString().trim();
							topOperARList=new ArrayList<>();
								if(lev == 1){
									topOperARList.add(m+1+"");
									topOperARList.add(objdepName);
									
								}else{
									topOperARList.add("");
									topOperARList.add("");
								}
							topOperARList.add(objDESC);
							topOperARList.add(objCNT);
							if(depOperCnt!=0){
								topOperARList.add(imputedRatio(Double.valueOf(objCNT + ""),Double.valueOf(depOperCnt))+"");
							}else{
								topOperARList.add("0");
							}
							}
							resultListSeven.add(topOperARList);
								lev++;
						}
					}
				}
			}
			
		}
		
		//加载第三个章节信息
		public void loadARThreeSection(Map<String, Object> dto, Map<String, Object> paramMap){
			// 获取DRG病组,内科组，外科组，操作组
			int totaldrgCnt =0;
			int outdrgcnt = 0;
			int indrgcnt = 0;
			int operdrgcnt = 0;
			int outcasecnt = 0;
			int incasecnt = 0;
			int opercasecnt = 0;
			Boolean hospDRGsListflag=true;
			List<Map<String,Object>> hospDRGsList = analysisDRGsReportApplication.findHospDRGsInfo(paramMap);
			
				for(Map<String,Object> hospDRGsInfoStep:hospDRGsList){
					while(hospDRGsListflag){
				     totaldrgCnt=Integer.parseInt(hospDRGsInfoStep.get("ALLDRGS")==null?"0":hospDRGsInfoStep.get("ALLDRGS").toString().trim());
					 outdrgcnt = Integer.parseInt(hospDRGsInfoStep.get("WKDRGS")==null?"0":hospDRGsInfoStep.get("WKDRGS").toString().trim());
					 indrgcnt = Integer.parseInt(hospDRGsInfoStep.get("NKDRGS")==null?"0":hospDRGsInfoStep.get("NKDRGS").toString().trim());
					 operdrgcnt = Integer.parseInt(hospDRGsInfoStep.get("CZDRGS")==null?"0":hospDRGsInfoStep.get("CZDRGS").toString().trim());
					 outcasecnt = Integer.parseInt(hospDRGsInfoStep.get("WKCNT")==null?"0":hospDRGsInfoStep.get("WKCNT").toString().trim());
					 incasecnt = Integer.parseInt(hospDRGsInfoStep.get("NKCNT")==null?"0":hospDRGsInfoStep.get("NKCNT").toString().trim());
					 opercasecnt = Integer.parseInt(hospDRGsInfoStep.get("CZCNT")==null?"0":hospDRGsInfoStep.get("CZCNT").toString().trim());
					 hospDRGsListflag=false;
					}
			}
	
			//数据传回前台
		    allMap.put("outdrgc",outdrgcnt);
		    allMap.put("indrgc",indrgcnt);
		    allMap.put("opdrgc",operdrgcnt);
		    allMap.put("outcasec",outcasecnt);
		    allMap.put("incasec",incasecnt);
		    allMap.put("opcasec",opercasecnt);
			
		    params.put("outdrgc",outdrgcnt);
		    params.put("indrgc",indrgcnt);
		    params.put("opdrgc",operdrgcnt);
		    
			params.put("outdrgcr", imputedRatio(Double.valueOf(outdrgcnt),Double.valueOf(totaldrgCnt)));
			params.put("indrgcr", imputedRatio(Double.valueOf(indrgcnt),Double.valueOf(totaldrgCnt)));
			params.put("opdrgcr", imputedRatio(Double.valueOf(operdrgcnt),Double.valueOf(totaldrgCnt)));
			int ooicasecnt=outcasecnt+incasecnt+opercasecnt;
			params.put("outcasecf", Arith.dataFormat(outcasecnt+"", "2"));
			params.put("outcasecr", imputedRatio(Double.valueOf(outcasecnt),Double.valueOf(ooicasecnt)));
			params.put("incasecf", Arith.dataFormat(incasecnt+"", "2"));
			params.put("incasecr", imputedRatio(Double.valueOf(incasecnt),Double.valueOf(ooicasecnt)));
			params.put("opcasecf", Arith.dataFormat(opercasecnt+"", "2"));
			params.put("opcasecr", imputedRatio(Double.valueOf(opercasecnt),Double.valueOf(ooicasecnt)));
		
			//DRG病组和病例复杂程度
			int DRGsType1Num = 0;
			int DRGsType3Num = 0;
			int DRGsType5Num = 0;
			int DRGsType9Num = 0;

			int CaseType1Num = 0;
			int CaseType3Num = 0;
			int CaseType5Num = 0;
			int CaseType9Num = 0;
			Boolean hospDRGsInfoListflag=true;
			List<Map<String,Object>> hospDRGsARList = analysisDRGsReportApplication.findPersonCnt(paramMap);
			
			for(Map<String,Object> map:hospDRGsARList){
				while(hospDRGsInfoListflag){
					DRGsType1Num = Integer.parseInt(map.get("DRGCA")==null?"0":map.get("DRGCA").toString().trim());
					DRGsType3Num = Integer.parseInt(map.get("DRGCB")==null?"0":map.get("DRGCB").toString().trim());
					DRGsType5Num = Integer.parseInt(map.get("DRGCC")==null?"0":map.get("DRGCC").toString().trim());
					CaseType1Num = Integer.parseInt(map.get("CASEA")==null?"0":map.get("CASEA").toString().trim());
					CaseType3Num = Integer.parseInt(map.get("CASEB")==null?"0":map.get("CASEB").toString().trim());
					CaseType5Num = Integer.parseInt(map.get("CASEC")==null?"0":map.get("CASEC").toString().trim());
				    hospDRGsInfoListflag=false;
				}
			}
			
			DRGsType9Num = totaldrgCnt - DRGsType1Num - DRGsType3Num - DRGsType5Num ;
			allMap.put("DRGsType1Num", DRGsType1Num);
			allMap.put("DRGsType3Num", DRGsType3Num);
			allMap.put("DRGsType5Num", DRGsType5Num);
			allMap.put("DRGsType9Num", DRGsType9Num);
		    params.put("DRGsType1Num", DRGsType1Num);
		    params.put("DRGsType3Num", DRGsType3Num);
		    params.put("DRGsType5Num", DRGsType5Num);
		    params.put("DRGsType9Num", DRGsType9Num);
      		if (params.get("ingpcacnt") != null) {
				CaseType9Num = Double.valueOf(params.get("ingroupcasecnt_temp") + "").intValue() - CaseType1Num - CaseType3Num - CaseType5Num ;
			} else {
				CaseType9Num = 0;
			}
      		allMap.put("CaseType1Num", CaseType1Num);
      		allMap.put("CaseType3Num", CaseType3Num);
      		allMap.put("CaseType5Num", CaseType5Num);
      		allMap.put("CaseType9Num", CaseType9Num);
      		params.put("CaseType1Num", CaseType1Num);
      		params.put("CaseType3Num", CaseType3Num);
      		params.put("CaseType5Num", CaseType5Num);
      		params.put("CaseType9Num", CaseType9Num);
      		
      		//图表3、10——各MDC专业本期和同期出院病例数分布、各MDC总权重分布图
			List<Map<String,Object>> MdcCntList = analysisDRGsReportApplication.findMdcCnt(paramMap);
			allMap.put("MdcCntList", MdcCntList);
			
			//章节3.1手术科室与非手术科室个数
			List<Map<String,Object>> depTypeCntList = analysisDRGsReportApplication.findDepTypeCnt(paramMap);
			if (depTypeCntList.size() > 0) {
				for (int i = 0; i < depTypeCntList.size(); i++) {
					Map<String,Object> depTypeobj = depTypeCntList.get(i);
					int depType = depTypeobj.get("DEPTYPE") == null ? 0 : Double.valueOf(depTypeobj.get("DEPTYPE") + "").intValue();
					int depTypeCnt = depTypeobj.get("DEPCNT") == null ? 0 : Double.valueOf(depTypeobj.get("DEPCNT") + "").intValue();
					if(depType == 0){
						params.put("noOperDepCnt", depTypeCnt);
					}else if (depType == 1){
						params.put("operDepCnt", depTypeCnt);
					}
				}
			}
			//图表6——手术科室CMI与总权重分布图
			List<Map<String, Object>> operDepQuotaCWList = analysisDRGsReportApplication.findOperDepQuota(paramMap,"1","CW");
			List<Map<String, Object>> operDepMapCWList = new ArrayList<Map<String, Object>>();

			StringBuffer operDepCMIAndTotalWeightQuadrantStr = new StringBuffer(); 
			
		    //散点图上是否抛出异常数据		    
		    abnormalMap = new HashMap<String, List<Map<String, Object>>>();
		    abnormalMap = abnorm.getAbnormalDataMap(operDepQuotaCWList, "weight", "cmi");//计算是否有异常数据
			List<Map<String, Object>> operAbnormalWeightAndCMIList = abnormalMap.get("abnorMapList");// 异常数据
			List<Map<String, Object>> opernormalWeightAndCMIList = new ArrayList<Map<String, Object>>();//正常数据
			opernormalWeightAndCMIList = abnormalMap.get("norMapList");// 参与计算数据
			StringBuffer operdepCmiWeightAbnormal = new StringBuffer();		
			//压入不正常的数据
			String operCWAbnormal="";
			for (Map<String, Object> map : operAbnormalWeightAndCMIList) {
		    	String operDesc = map.get("DECC") == null ? "--" : map.get("DECC")+"";
				Double CMI = Arith.round(Double.valueOf(String.valueOf(map.get("CMI") == null ? 0 : map.get("CMI").toString())),2);
		    	Double totalWeight = Arith.round(Double.valueOf(String.valueOf(map.get("TOTALWEIGHT") == null ? 0 : map.get("TOTALWEIGHT").toString())),2);
		    	operdepCmiWeightAbnormal.append(operDesc + "(" + CMI + "," + totalWeight + ")、");
			}
			if (operdepCmiWeightAbnormal.lastIndexOf("、") > 0) {
				operCWAbnormal= operdepCmiWeightAbnormal.substring(0, operdepCmiWeightAbnormal.lastIndexOf("、"))+"";
				params.put("operCWAbnormal","其中"+operCWAbnormal+"数据作为特异数据，因为会影响图形展现效果，未显示在下图中。其他");
			}else{
				params.put("operCWAbnormal","");
			}
			
			for (int i = 0;i<opernormalWeightAndCMIList.size();i++) {
				Map<String, Object> obj=opernormalWeightAndCMIList.get(i);
					Double CMI = Arith.round(Double.valueOf(String.valueOf(obj.get("CMI") == null ? 0 : obj.get("CMI").toString())),2);
					Double totalWeight = Arith.round(Double.valueOf(String.valueOf(obj.get("TOTALWEIGHT") == null ? 0 : obj.get("TOTALWEIGHT").toString())),2);
					String depName=obj.get("DECC") == null ? "--" : obj.get("DECC")+"";
					if(i == 0){
						operDepCMIAndTotalWeightQuadrantStr.append(depName+"("+CMI+","+totalWeight+")");
					}else{
						operDepCMIAndTotalWeightQuadrantStr.append("，"+depName+"("+CMI+","+totalWeight+")");
					}
					
					Map<String, Object> map = new HashMap<String, Object>();
					map.put("depCode", obj.get("CODE")==null?"--":(obj.get("CODE")+"").trim());
					map.put("depName", depName.trim());
					map.put("CMI", CMI+"");
					map.put("totalWeight",totalWeight+"");
					operDepMapCWList.add(map);
					params.put("operDepCMIAndTotalWeightQuadrantStr", operDepCMIAndTotalWeightQuadrantStr.toString());
					
			}
			allMap.put("operDepMapCWList", operDepMapCWList);
			
			//图表8——手术科室时间消耗指数和费用消耗指数分布图
			List<Map<String, Object>> operDepQuotaEFList = analysisDRGsReportApplication.findOperDepQuota(paramMap,"1","EF");
			List<Map<String, Object>> operDepMapEFList = new ArrayList<Map<String, Object>>();

			StringBuffer operDepFeeEffAndTimeEffQuadrantStr = new StringBuffer(); 
			
			for (int i = 0;i<operDepQuotaEFList.size();i++) {
				Map<String, Object> obj=operDepQuotaEFList.get(i);
					Double fee = Arith.round(Double.valueOf(String.valueOf(obj.get("FEE") == null ? 0 : obj.get("FEE").toString())),2);
					Double time = Arith.round(Double.valueOf(String.valueOf(obj.get("TIM") == null ? 0 : obj.get("TIM").toString())),2);
					String depName=obj.get("DECC") == null ? "--" : obj.get("DECC")+"";
					if(i == 0){
						operDepFeeEffAndTimeEffQuadrantStr.append(depName+"("+time+","+fee+")");
					}else{
						operDepFeeEffAndTimeEffQuadrantStr.append("，"+depName+"("+time+","+fee+")");//拼接描述的字符串
					}
					
					Map<String, Object> map = new HashMap<String, Object>();
					map.put("depCode", obj.get("CODE")==null?"--":(obj.get("CODE")+"").trim());
					map.put("depName", depName.trim());
					map.put("feeEff", fee+"");
					map.put("timeEff",time+"");
					operDepMapEFList.add(map);
					params.put("operDepFeeEffAndTimeEffQuadrantStr", operDepFeeEffAndTimeEffQuadrantStr.toString());
					
			}
			allMap.put("operDepMapEFList", operDepMapEFList);
			
			//图表7——非手术科室CMI与总权重分布图
			List<Map<String, Object>> noOperDepQuotaCWList = analysisDRGsReportApplication.findOperDepQuota(paramMap,"0","CW");
			List<Map<String, Object>> noOperDepMapCWList = new ArrayList<Map<String, Object>>();

			StringBuffer noOperDepCMIAndTotalWeightQuadrantStr = new StringBuffer(); 
			
		    //散点图上是否抛出异常数据		    
		    abnormalMap = new HashMap<String, List<Map<String, Object>>>();
		    abnormalMap = abnorm.getAbnormalDataMap(noOperDepQuotaCWList, "weight", "cmi");//计算是否有异常数据
			List<Map<String, Object>> noOperAbnormalWeightAndCMIList = abnormalMap.get("abnorMapList");// 异常数据
			List<Map<String, Object>> noOpernormalWeightAndCMIList = new ArrayList<Map<String, Object>>();//正常数据
			noOpernormalWeightAndCMIList = abnormalMap.get("norMapList");// 参与计算数据
			StringBuffer noOperdepCmiWeightAbnormal = new StringBuffer();		
			//压入不正常的数据
			String noOperCWAbnormal="";
			for (Map<String, Object> map : noOperAbnormalWeightAndCMIList) {
		    	String noOperDesc = map.get("DECC") == null ? "--" : map.get("DECC")+"";
				Double CMI = Arith.round(Double.valueOf(String.valueOf(map.get("CMI") == null ? 0 : map.get("CMI").toString())),2);
		    	Double totalWeight = Arith.round(Double.valueOf(String.valueOf(map.get("TOTALWEIGHT") == null ? 0 : map.get("TOTALWEIGHT").toString())),2);
		    	noOperdepCmiWeightAbnormal.append(noOperDesc + "(" + CMI + "," + totalWeight + ")、");
			}
			if (noOperdepCmiWeightAbnormal.lastIndexOf("、") > 0) {
				noOperCWAbnormal= noOperdepCmiWeightAbnormal.substring(0, noOperdepCmiWeightAbnormal.lastIndexOf("、"))+"";
				params.put("noOperCWAbnormal","其中"+noOperCWAbnormal+"数据作为特异数据，因为会影响图形展现效果，未显示在下图中。其他");
			}else{
				params.put("noOperCWAbnormal","");
			}
			
			for (int i = 0;i<noOpernormalWeightAndCMIList.size();i++) {
				Map<String, Object> obj=noOpernormalWeightAndCMIList.get(i);
					Double CMI = Arith.round(Double.valueOf(String.valueOf(obj.get("CMI") == null ? 0 : obj.get("CMI").toString())),2);
					Double totalWeight = Arith.round(Double.valueOf(String.valueOf(obj.get("TOTALWEIGHT") == null ? 0 : obj.get("TOTALWEIGHT").toString())),2);
					String depName=obj.get("DECC") == null ? "--" : obj.get("DECC")+"";
					if(i == 0){
						noOperDepCMIAndTotalWeightQuadrantStr.append(depName+"("+CMI+","+totalWeight+")");
					}else{
						noOperDepCMIAndTotalWeightQuadrantStr.append("，"+depName+"("+CMI+","+totalWeight+")");
					}
					
					Map<String, Object> map = new HashMap<String, Object>();
					map.put("depCode", obj.get("CODE")==null?"--":(obj.get("CODE")+"").trim());
					map.put("depName", depName.trim());
					map.put("CMI", CMI+"");
					map.put("totalWeight",totalWeight+"");
					noOperDepMapCWList.add(map);
					params.put("noOperDepCMIAndTotalWeightQuadrantStr", noOperDepCMIAndTotalWeightQuadrantStr.toString());
					
			}
			allMap.put("noOperDepMapCWList", noOperDepMapCWList);
			
			//图表9——非手术科室时间消耗指数和费用消耗指数分布图
			List<Map<String, Object>> noOperDepQuotaEFList = analysisDRGsReportApplication.findOperDepQuota(paramMap,"0","EF");
			List<Map<String, Object>> noOperDepMapEFList = new ArrayList<Map<String, Object>>();

			StringBuffer noOperDepFeeEffAndTimeEffQuadrantStr = new StringBuffer(); 
			
			for (int i = 0;i<noOperDepQuotaEFList.size();i++) {
				Map<String, Object> obj=noOperDepQuotaEFList.get(i);
					Double CMI = Arith.round(Double.valueOf(String.valueOf(obj.get("CMI") == null ? 0 : obj.get("CMI").toString())),2);
					Double totalWeight = Arith.round(Double.valueOf(String.valueOf(obj.get("TOTALWEIGHT") == null ? 0 : obj.get("TOTALWEIGHT").toString())),2);
					Double fee = Arith.round(Double.valueOf(String.valueOf(obj.get("FEE") == null ? 0 : obj.get("FEE").toString())),2);
					Double time = Arith.round(Double.valueOf(String.valueOf(obj.get("TIM") == null ? 0 : obj.get("TIM").toString())),2);
					String depName=obj.get("DECC") == null ? "--" : obj.get("DECC")+"";
					if(i == 0){
						noOperDepCMIAndTotalWeightQuadrantStr.append(depName+"("+CMI+","+totalWeight+")");
						noOperDepFeeEffAndTimeEffQuadrantStr.append(depName+"("+time+","+fee+")");
					}else{
						noOperDepCMIAndTotalWeightQuadrantStr.append("，"+depName+"("+CMI+","+totalWeight+")");
						noOperDepFeeEffAndTimeEffQuadrantStr.append("，"+depName+"("+time+","+fee+")");//拼接描述的字符串
					}
					
					Map<String, Object> map = new HashMap<String, Object>();
					map.put("depCode", obj.get("CODE")==null?"--":(obj.get("CODE")+"").trim());
					map.put("depName", depName.trim());
					map.put("feeEff", fee+"");
					map.put("timeEff",time+"");
					map.put("CMI", CMI+"");
					map.put("totalWeight",totalWeight+"");
					noOperDepMapEFList.add(map);
					params.put("noOperDepFeeEffAndTimeEffQuadrantStr", noOperDepFeeEffAndTimeEffQuadrantStr.toString());
					
			}
			allMap.put("noOperDepMapEFList", noOperDepMapEFList);
			
			//全院低风险组死亡病例科室分布表
			List<Map<String, Object>> depDeadRiskAList = analysisDRGsReportApplication.findDepByRiskAList(paramMap);
		    int depDeaRiskACnt=0; //全院出现低风险组死亡病例
			StringBuffer depDeaRiskADepList = new StringBuffer(); 
			String depDeaRiskAWordList="，出现低风险组死亡病例的科室，按照低风险组死亡病例数由高至低排列，科室的低风险组死亡病例数和低风险死亡率依次为";
		    if(depDeadRiskAList.size()<1){
		    	params.put("depDeaRiskAWordList","");
		    	params.put("depDeaRiskADepList","");
		    }else{
		    	 for(int i=0;i<depDeadRiskAList.size();i++){
		    		 Map<String, Object> obj = depDeadRiskAList.get(i);
		    		 int resk1DeadCnt = obj.get("DCN") == null ? 0 : Double.valueOf(obj.get("DCN") + "").intValue();
					 Double resk1DeadRatio = Arith.round(Double.valueOf(String.valueOf(obj.get("RAT") == null ? 0 : obj.get("RAT").toString())),2);
					 String depName=obj.get("DEP") == null ? "--" : obj.get("DEP")+"";
					 depDeaRiskACnt+=Double.valueOf(obj.get("DCN")==null?"0":obj.get("DCN").toString().trim());
					 if(i == 0){
						 depDeaRiskADepList.append(depName+"("+resk1DeadCnt+","+resk1DeadRatio+"%)");
					 }else{
						 depDeaRiskADepList.append("，"+depName+"("+resk1DeadCnt+","+resk1DeadRatio+"%)");
					 }
					 params.put("depDeaRiskAWordList",depDeaRiskAWordList);
					 params.put("depDeaRiskADepList",depDeaRiskADepList.toString());
				    }
		    }
		    params.put("depDeaRiskACnt",depDeaRiskACnt);
		    
			//全院中低风险组死亡病例科室分布表
			List<Map<String, Object>> depDeadRiskBList = analysisDRGsReportApplication.findDepByRiskBList(paramMap);
		    int depDeaRiskBCnt=0; //全院出现中低风险组死亡病例
			StringBuffer depDeaRiskBDepList = new StringBuffer(); 
			String depDeaRiskBWordList="，出现中低风险组死亡病例的科室，按照中低风险组死亡病例数由高至低排列，科室的中低风险组死亡病例数和中低风险死亡率依次为";
		    if(depDeadRiskBList.size()<1){
		    	params.put("depDeaRiskBWordList","");
		    	params.put("depDeaRiskBDepList","");
		    }else{
		    	 for(int i=0;i<depDeadRiskBList.size();i++){
		    		 Map<String, Object> obj = depDeadRiskBList.get(i);
		    		 int resk2DeadCnt = obj.get("DCN") == null ? 0 : Double.valueOf(obj.get("DCN") + "").intValue();
					 Double resk2DeadRatio = Arith.round(Double.valueOf(String.valueOf(obj.get("RAT") == null ? 0 : obj.get("RAT").toString())),2);
					 String depName=obj.get("DEP") == null ? "--" : obj.get("DEP")+"";
					 depDeaRiskBCnt+=Double.valueOf(obj.get("DCN")==null?"0":obj.get("DCN").toString().trim());
					 if(i == 0){
						 depDeaRiskBDepList.append(depName+"("+resk2DeadCnt+","+resk2DeadRatio+"%)");
					 }else{
						 depDeaRiskBDepList.append("，"+depName+"("+resk2DeadCnt+","+resk2DeadRatio+"%)");
					 }
					 params.put("depDeaRiskBWordList",depDeaRiskBWordList);
					 params.put("depDeaRiskBDepList",depDeaRiskBDepList.toString());
				    }
		    }		   
		    params.put("depDeaRiskBCnt",depDeaRiskBCnt);
		    
		    //MDC覆盖率前五位专业及覆盖率
		    List<Map<String, Object>> MDCRatioList = analysisDRGsReportApplication.findMDCRatioList(paramMap);
		    StringBuffer MDCAndMdcRatioList = new StringBuffer(); 
		    for(int i=0;i<5;i++){
		    	Map<String, Object> mdcobj = MDCRatioList.get(i);
		    	String mdcCode = mdcobj.get("MDC") == null ? "--" : mdcobj.get("MDC")+"";
		    	String mdcDesc = mdcobj.get("MDCDESC") == null ? "--" : mdcobj.get("MDCDESC")+"";
		    	Double DRGRatio = Arith.round(Double.valueOf(String.valueOf(mdcobj.get("DRGRATIO") == null ? 0 : mdcobj.get("DRGRATIO").toString())),2);
		    	if(i == 0){
		    		 MDCAndMdcRatioList.append(mdcCode+"-"+mdcDesc+"("+DRGRatio+"%)");
				 }else{
					 MDCAndMdcRatioList.append("、"+mdcCode+"-"+mdcDesc+"("+DRGRatio+"%)");
				 }
		    	params.put("MDCAndMdcRatioList",MDCAndMdcRatioList);
		    }
		    
		    //MDC专业CMI及总权重
		    List<Map<String, Object>> MDCCMIAndTotalWeightList = analysisDRGsReportApplication.findAllmdcDRGsList(paramMap);
		    GetAbnormity quotasMid = new GetAbnormity();// 调用中位数获取方法
		    List<Double> MDCCMIlist = new ArrayList<Double>();
		    List<Double> MDCWeightlist = new ArrayList<Double>();
		    for (Map<String, Object> objlist : MDCCMIAndTotalWeightList) {
		    	MDCCMIlist.add(Double.valueOf((objlist.get("CMI") == null ? 0 :objlist.get("CMI")) + ""));
		    	MDCWeightlist.add(Double.valueOf((objlist.get("WEIGHT") == null ? 0 :objlist.get("WEIGHT")) + ""));
			}
		    double CMImid = Arith.round(quotasMid.getMedian(MDCCMIlist),2);
		    double totalWeightmid = Arith.round(quotasMid.getMedian(MDCWeightlist),2);
		    
		    //散点图上是否抛出异常数据		    
		    abnormalMap = new HashMap<String, List<Map<String, Object>>>();
		    abnormalMap = abnorm.getAbnormalDataMap(MDCCMIAndTotalWeightList, "weight", "cmi");//计算是否有异常数据
			List<Map<String, Object>> MDCAbnormalWeightAndCMIList = abnormalMap.get("abnorMapList");// 异常数据
			List<Map<String, Object>> MDCnormalWeightAndCMIList = new ArrayList<Map<String, Object>>();//正常数据
			MDCnormalWeightAndCMIList = abnormalMap.get("norMapList");// 参与计算数据
			StringBuffer depCmiWeightAbnormal = new StringBuffer();		
			//压入不正常的数据
			String MDCCWAbnormal="";
			for (Map<String, Object> map : MDCAbnormalWeightAndCMIList) {
				String mdcCode = map.get("CODE") == null ? "--" : map.get("CODE")+"";
		    	String mdcDesc = map.get("DECC") == null ? "--" : map.get("DECC")+"";
				Double CMI = Arith.round(Double.valueOf(String.valueOf(map.get("CMI") == null ? 0 : map.get("CMI").toString())),2);
		    	Double totalWeight = Arith.round(Double.valueOf(String.valueOf(map.get("WEIGHT") == null ? 0 : map.get("WEIGHT").toString())),2);
				depCmiWeightAbnormal.append(mdcCode + "-" + mdcDesc + "(" + CMI + "," + totalWeight + ")、");
			}
			if (depCmiWeightAbnormal.lastIndexOf("、") > 0) {
				MDCCWAbnormal= depCmiWeightAbnormal.substring(0, depCmiWeightAbnormal.lastIndexOf("、"))+"";
				params.put("MDCCWAbnormal","，其中"+MDCCWAbnormal+"数据作为特异数据，因为会影响图形展现效果，未显示在下图中");
			}else{
				params.put("MDCCWAbnormal","");
			}
		    allMap.put("CMImid",CMImid);
		    allMap.put("totalWeightmid",totalWeightmid);
		    allMap.put("MDCnormalWeightAndCMIList",MDCnormalWeightAndCMIList);
		    int MDCCMIWeightLowN=0;
		    int MDCCMIWeightHighN=0;
		    StringBuffer MDCCMIWeightHighList = new StringBuffer(); 
		    StringBuffer MDCCMIWeightLowList = new StringBuffer(); 
		    String MDCCMIWeightHighWord="，各MDC专业的CMI和总权重分别为";
		    String MDCCMIWeightLowWord="，各MDC专业的CMI和总权重分别为";
		    for (int i=0;i<MDCCMIAndTotalWeightList.size();i++){
		    	Map<String, Object> mdcobj = MDCCMIAndTotalWeightList.get(i);
			    String mdcCode = mdcobj.get("CODE") == null ? "--" : mdcobj.get("CODE")+"";
		    	String mdcDesc = mdcobj.get("DECC") == null ? "--" : mdcobj.get("DECC")+"";
		    	Double CMI = Arith.round(Double.valueOf(String.valueOf(mdcobj.get("CMI") == null ? 0 : mdcobj.get("CMI").toString())),2);
		    	Double totalWeight = Arith.round(Double.valueOf(String.valueOf(mdcobj.get("WEIGHT") == null ? 0 : mdcobj.get("WEIGHT").toString())),2);
		    	if(CMI>CMImid&&totalWeight>totalWeightmid){
		    		MDCCMIWeightHighN++;
		    		if(MDCCMIWeightHighN==1){
		    			MDCCMIWeightHighList.append(mdcCode+"-"+mdcDesc+"("+CMI+","+totalWeight+")");
		    		}else{
		    			MDCCMIWeightHighList.append("、"+mdcCode+"-"+mdcDesc+"("+CMI+","+totalWeight+")");
		    		}
		    		params.put("MDCCMIWeightHighWord",MDCCMIWeightHighWord);
		    		params.put("MDCCMIWeightHighList",MDCCMIWeightHighList.toString());
		    	}else if(CMI<CMImid&&totalWeight<totalWeightmid){
		    		MDCCMIWeightLowN++;
		    		if(MDCCMIWeightLowN==1){
		    			MDCCMIWeightLowList.append(mdcCode+"-"+mdcDesc+"("+CMI+","+totalWeight+")");
		    		}else{
		    			MDCCMIWeightLowList.append("、"+mdcCode+"-"+mdcDesc+"("+CMI+","+totalWeight+")");
		    		}
		    		params.put("MDCCMIWeightLowWord",MDCCMIWeightLowWord);
		    		params.put("MDCCMIWeightLowList",MDCCMIWeightLowList.toString());
		    	}
		    	if(MDCCMIWeightLowN==0){
		    		params.put("MDCCMIWeightLowWord","");
		    		params.put("MDCCMIWeightLowList","");
		    	}
		    	if(MDCCMIWeightHighN==0){
		    		params.put("MDCCMIWeightHighWord","");
		    		params.put("MDCCMIWeightHighList","");
		    	}
		    }
		    params.put("MDCCMIWeightLowN",MDCCMIWeightLowN);
		    params.put("MDCCMIWeightHighN",MDCCMIWeightHighN);
		    
		    
		    //MDC时间消耗指数费用消耗指数
		    List<Map<String, Object>> MDCTimeAndFeeEffList = analysisDRGsReportApplication.findAllmdcDRGsList(paramMap);
		    StringBuffer MDCTimeFeeHighList = new StringBuffer(); 
		    StringBuffer MDCTimeFeeLowList = new StringBuffer(); 
		    String MDCTimeFeeHighWord="，各MDC专业的时间消耗指数和费用消耗指数分别为";
		    String MDCTimeFeeLowWord="，各MDC专业的时间消耗指数和费用消耗指数分别为";
		    int MDCTimeFeeLowN=0;
		    int MDCTimeFeeHighN=0;
		    for(int i=0;i<MDCTimeAndFeeEffList.size();i++){
		    	Map<String, Object> mdcobj = MDCTimeAndFeeEffList.get(i);
			    String mdcCode = mdcobj.get("CODE") == null ? "--" : mdcobj.get("CODE")+"";
		    	String mdcDesc = mdcobj.get("DECC") == null ? "--" : mdcobj.get("DECC")+"";
		    	Double timeEff = Arith.round(Double.valueOf(String.valueOf(mdcobj.get("TIME") == null ? 0 : mdcobj.get("TIME").toString())),2);
		    	Double feeEff = Arith.round(Double.valueOf(String.valueOf(mdcobj.get("FEE") == null ? 0 : mdcobj.get("FEE").toString())),2);
		    	if(timeEff<1&&feeEff<1){
		    		MDCTimeFeeLowN++;
		    		if(MDCTimeFeeLowN==1){
		    			MDCTimeFeeLowList.append(mdcCode+"-"+mdcDesc+"("+timeEff+","+feeEff+")");
		    		}else{
		    			MDCTimeFeeLowList.append("、"+mdcCode+"-"+mdcDesc+"("+timeEff+","+feeEff+")");
		    		}
		    		params.put("MDCTimeFeeLowWord",MDCTimeFeeLowWord);
		    		params.put("MDCTimeFeeLowList",MDCTimeFeeLowList.toString());
		    	}else if(timeEff>1&&feeEff>1){
		    		MDCTimeFeeHighN++;
		    		if(MDCTimeFeeHighN==1){
		    			MDCTimeFeeHighList.append(mdcCode+"-"+mdcDesc+"("+timeEff+","+feeEff+")");
		    		}else{
		    			MDCTimeFeeHighList.append("、"+mdcCode+"-"+mdcDesc+"("+timeEff+","+feeEff+")");
		    		}
		    		params.put("MDCTimeFeeHighWord",MDCTimeFeeHighWord);
		    		params.put("MDCTimeFeeHighList",MDCTimeFeeHighList.toString());
		    	}
		    	if(MDCTimeFeeLowN==0){
		    		params.put("MDCTimeFeeLowWord","");
		    		params.put("MDCTimeFeeLowList","");
		    	}
		    	if(MDCTimeFeeHighN==0){
		    		params.put("MDCTimeFeeHighWord","");
		    		params.put("MDCTimeFeeHighList","");
		    	}
		    }
		    params.put("MDCTimeFeeLowN",MDCTimeFeeLowN);
		    params.put("MDCTimeFeeHighN",MDCTimeFeeHighN);
		    
		    //DRG低风险死亡
			List<Map<String, Object>> DRGDeadRiskAList = analysisDRGsReportApplication.findDRGByRiskAList(paramMap);
			StringBuffer DRGDeaRiskADRGList = new StringBuffer(); 
			String DRGDeaRiskAWordList="，按照低风险组死亡病例数由高至低排列，各低风险死亡DRG病组的死亡病例数和死亡率依次为";
		    if(DRGDeadRiskAList.size()<1){
		    	params.put("DRGDeaRiskAWordList","");
		    	params.put("DRGDeaRiskADRGList","");
		    }else{
		    	 for(int i=0;i<DRGDeadRiskAList.size();i++){
		    		 Map<String, Object> obj = DRGDeadRiskAList.get(i);
		    		 int resk1DeadCnt = obj.get("DCN") == null ? 0 : Double.valueOf(obj.get("DCN") + "").intValue();
					 Double resk1DeadRatio = Arith.round(Double.valueOf(String.valueOf(obj.get("RAT") == null ? 0 : obj.get("RAT").toString())),2);
					 String DRGName=obj.get("DRG") == null ? "--" : obj.get("DRG")+"";
					 if(i == 0){
						 DRGDeaRiskADRGList.append(DRGName+"("+resk1DeadCnt+","+resk1DeadRatio+"%)");
					 }else{
						 DRGDeaRiskADRGList.append("，"+DRGName+"("+resk1DeadCnt+","+resk1DeadRatio+"%)");
					 }
					 params.put("DRGDeaRiskAWordList",DRGDeaRiskAWordList);
					 params.put("DRGDeaRiskADRGList",DRGDeaRiskADRGList.toString());
				    }
		    }
		    
		    //DRG中低风险死亡
			List<Map<String, Object>> DRGDeadRiskBList = analysisDRGsReportApplication.findDRGByRiskBList(paramMap);
			StringBuffer DRGDeaRiskBDRGList = new StringBuffer(); 
			String DRGDeaRiskBWordList="，按照中低风险组死亡病例数由高至低排列，各中低风险死亡DRG病组的死亡病例数和死亡率依次为";
		    if(DRGDeadRiskBList.size()<1){
		    	params.put("DRGDeaRiskBWordList","");
		    	params.put("DRGDeaRiskBDRGList","");
		    }else{
		    	 for(int i=0;i<DRGDeadRiskBList.size();i++){
		    		 Map<String, Object> obj = DRGDeadRiskBList.get(i);
		    		 int resk2DeadCnt = obj.get("DCN") == null ? 0 : Double.valueOf(obj.get("DCN") + "").intValue();
					 Double resk2DeadRatio = Arith.round(Double.valueOf(String.valueOf(obj.get("RAT") == null ? 0 : obj.get("RAT").toString())),2);
					 String DRGName=obj.get("DRG") == null ? "--" : obj.get("DRG")+"";
					 if(i == 0){
						 DRGDeaRiskBDRGList.append(DRGName+"("+resk2DeadCnt+","+resk2DeadRatio+"%)");
					 }else{
						 DRGDeaRiskBDRGList.append("，"+DRGName+"("+resk2DeadCnt+","+resk2DeadRatio+"%)");
					 }
					 params.put("DRGDeaRiskBWordList",DRGDeaRiskBWordList);
					 params.put("DRGDeaRiskBDRGList",DRGDeaRiskBDRGList.toString());
				    }
		    }		   
		}
		
		//加载第四个章节信息
		public void loadARFourSection(Map<String, Object> dto, Map<String, Object> paramMap){
			
			//表格 8  一二级手术例数最多的前十名医师列表
			List<Map<String, Object>> docOperAList = analysisDRGsReportApplication.findDocOperAList(paramMap);
			resultListEight=new ArrayList<List<String>>();
			List<String> docOperAListT =new ArrayList<String>();
			  if(docOperAList.size()<1){
				  docOperAListT =new ArrayList<String>();
				  docOperAListT.add("-");
				  docOperAListT.add("-");
				  docOperAListT.add("-");
				  docOperAListT.add("-");
				  docOperAListT.add("-");
				  docOperAListT.add("-");
				  docOperAListT.add("-");
				  docOperAListT.add("-");
				  resultListEight.add(docOperAListT);
			  }else{
				  int docOperAListNum=1;
				  for(Map<String, Object> obj:docOperAList){
					  docOperAListT =new ArrayList<String>();
					  docOperAListT.add(docOperAListNum+"");
					  docOperAListNum++;
					  docOperAListT.add(obj.get("DOC")==null?"--":obj.get("DOC").toString().trim());
					  docOperAListT.add(obj.get("DEP")==null?"--":obj.get("DEP").toString().trim());
					  docOperAListT.add(Arith.dataFormat(obj.get("CNT")==null?"0":obj.get("CNT").toString().trim(), "2"));
					  docOperAListT.add(Arith.dataFormat(obj.get("FSCNT")==null?"0":obj.get("FSCNT").toString().trim(), "2"));
					  docOperAListT.add(obj.get("RAT")==null?"0":obj.get("RAT").toString().trim());
					  docOperAListT.add(Arith.dataFormat(obj.get("FINCNT")==null?"0":obj.get("FINCNT").toString().trim(), "2"));
					  docOperAListT.add(obj.get("FCMI")==null?"0":obj.get("FCMI").toString().trim());
					  resultListEight.add(docOperAListT);
				  }
			  }
			
				//表格9 三四级手术例数最多的前十名医师列表
				List<Map<String, Object>> docOperBList = analysisDRGsReportApplication.findDocOperBList(paramMap);
				resultListNine=new ArrayList<List<String>>();
				List<String> docOperBListT =new ArrayList<String>();
				  if(docOperBList.size()<1){
					  docOperBListT =new ArrayList<String>();
					  docOperBListT.add("-");
					  docOperBListT.add("-");
					  docOperBListT.add("-");
					  docOperBListT.add("-");
					  docOperBListT.add("-");
					  docOperBListT.add("-");
					  docOperBListT.add("-");
					  docOperBListT.add("-");
					  resultListNine.add(docOperBListT);
				  }else{
					  int docOperBListNum=1;
					  for(Map<String, Object> obj:docOperBList){
						  docOperBListT =new ArrayList<String>();
						  docOperBListT.add(docOperBListNum+"");
						  docOperBListNum++;
						  docOperBListT.add(obj.get("DOC")==null?"--":obj.get("DOC").toString().trim());
						  docOperBListT.add(obj.get("DEP")==null?"--":obj.get("DEP").toString().trim());
						  docOperBListT.add(Arith.dataFormat(obj.get("CNT")==null?"0":obj.get("CNT").toString().trim(), "2"));
						  docOperBListT.add(Arith.dataFormat(obj.get("FSCNT")==null?"0":obj.get("FSCNT").toString().trim(), "2"));
						  docOperBListT.add(obj.get("RAT")==null?"0":obj.get("RAT").toString().trim());
						  docOperBListT.add(Arith.dataFormat(obj.get("FINCNT")==null?"0":obj.get("FINCNT").toString().trim(), "2"));
						  docOperBListT.add(obj.get("FCMI")==null?"0":obj.get("FCMI").toString().trim());
						  resultListNine.add(docOperBListT);
					  }
				  }
		}
		
		//加载第五个章节信息
		public void loadARFiveSection(Map<String, Object> dto, Map<String, Object> paramMap){
			
			//获取重点MDC
			String mdcCode = dto.get("mdcCode")==null?"--":dto.get("mdcCode").toString().trim();
			mdcCode = mdcCode.replaceAll("\\s*", "");// 去除空格	
			String mdccodeStr="";
			if (mdcCode.length() > 4) {
				String[] mdc = mdcCode.split("&");
				if (mdc.length > 1) {
					StringBuffer mdcs = new StringBuffer();
					for (int x = 0; x < mdc.length; x++) {
						mdcs.append("'" + mdc[x] + "',");
					}
					if(mdcs.length()>0){
						mdccodeStr=mdcs.substring(0, mdcs.lastIndexOf(","))+"";
					}
				}
			} else {
				mdccodeStr="'" + mdcCode + "'";
			}
			paramMap.put("mdcCode",mdccodeStr);
			List<Map<String, Object>>  mdcdescList = analysisDRGsReportApplication.findMdcDescAndCnt(paramMap);
			String mdcStr="";
			int mainMdcCnt=0;
			String mainMdcCntRatio="0%";
			for(Map<String, Object> obj:mdcdescList){
				mdcStr+=obj.get("MDC_CODE")+"("+obj.get("MDC_DESC")+")、";
				mainMdcCnt+=Double.valueOf(obj.get("MDCCNT")==null?"0":obj.get("MDCCNT").toString().trim());
			}
			mdcStr= mdcStr.substring(0, mdcStr.lastIndexOf("、"))+"";
			if(params.get("hospoutcasecnt_temp")!="0"){
				mainMdcCntRatio = (Arith.mul(Arith.div(Double.valueOf(mainMdcCnt), Double.valueOf(params.get("hospoutcasecnt_temp") + ""), 4), 100))+"%";
			}
			String mainMdcCntF = Arith.dataFormat(Double.toString(mainMdcCnt),"2");
			params.put("mdcStr", mdcStr);
			params.put("mainMdcCnt", mainMdcCntF);
			params.put("mainMdcCntRatio", mainMdcCntRatio);
			//重点专科DRG组数及占比
			int  mdcDRGsCnt = analysisDRGsReportApplication.findMdcDRGsCnt(paramMap);
			int  mdcDRGsRealCnt = analysisDRGsReportApplication.findMdcDRGsRealCnt(paramMap);
			String mdcDrgsCntRatio="0";
			if(mdcDRGsCnt!=0){
				mdcDrgsCntRatio = (Arith.mul(Arith.div(Double.valueOf(mdcDRGsRealCnt), Double.valueOf(mdcDRGsCnt), 4), 100))+"%";
			}else{
				mdcDrgsCntRatio="0";
			}
			params.put("mdcDRGsCnt", mdcDRGsCnt);
			params.put("mdcDRGsRealCnt", mdcDRGsRealCnt);
			params.put("mdcDrgsCntRatio", mdcDrgsCntRatio);
			
			//重点专业出院病例数排名前十病组
			List<Map<String, Object>>  top10DRGsCntByMDCList = analysisDRGsReportApplication.findDRGsTop10CntByMDC(paramMap);
			resultListTen=new ArrayList<List<String>>();
			List<String> top10DRGsCntByMDC =new ArrayList<String>();
			if(top10DRGsCntByMDCList.size()<1){
				top10DRGsCntByMDC =new ArrayList<String>();
				top10DRGsCntByMDC.add("-");
				top10DRGsCntByMDC.add("-");
				top10DRGsCntByMDC.add("-");
				top10DRGsCntByMDC.add("-");
				top10DRGsCntByMDC.add("-");
				top10DRGsCntByMDC.add("-");
				resultListTen.add(top10DRGsCntByMDC);
			}else{
				int top10DRGsCntByMDCListN=1;
				int MDCtop10DRGstotalCnt = 0;
				String MDCtop10DRGsCntRatio ="";
				for(Map<String, Object> obj:top10DRGsCntByMDCList){
					top10DRGsCntByMDC =new ArrayList<String>();
					MDCtop10DRGstotalCnt+=Double.valueOf(obj.get("CNT")==null?"0":obj.get("CNT").toString().trim());
					String drgsCntRatio=(Arith.mul(Arith.div(Double.valueOf(obj.get("CNT")==null?"0":obj.get("CNT").toString().trim()),Double.valueOf(mainMdcCnt), 4), 100))+"";					
					top10DRGsCntByMDC.add(top10DRGsCntByMDCListN+"");
					top10DRGsCntByMDCListN++;
					top10DRGsCntByMDC.add(obj.get("PARDRG_CODE")==null?"-":obj.get("PARDRG_CODE").toString().trim());
					top10DRGsCntByMDC.add(obj.get("DRG_DESC")==null?"-":obj.get("DRG_DESC").toString().trim());
					top10DRGsCntByMDC.add(Arith.dataFormat(obj.get("CNT")==null?"0":obj.get("CNT").toString().trim(),"2"));
					top10DRGsCntByMDC.add(drgsCntRatio);
					top10DRGsCntByMDC.add(Arith.dataFormat(obj.get("AS_WEIGHT")==null?"0":obj.get("AS_WEIGHT").toString().trim(),"1"));					
					resultListTen.add(top10DRGsCntByMDC);
				}
				if(MDCtop10DRGstotalCnt!=0){
					MDCtop10DRGsCntRatio = (Arith.mul(Arith.div(MDCtop10DRGstotalCnt,Double.valueOf(mainMdcCnt), 4), 100))+"%";
				}
				String MDCtop10DRGstotalCntF = Arith.dataFormat(Double.toString(MDCtop10DRGstotalCnt),"2");
				params.put("MDCtop10DRGstotalCnt", MDCtop10DRGstotalCntF);
				params.put("MDCtop10DRGsCntRatio", MDCtop10DRGsCntRatio);
			}
			
			//重点专业总权重排名前十病组
			List<Map<String, Object>>  top10DRGsWeightByMDCList = analysisDRGsReportApplication.findDRGsTop10WeightByMDC(paramMap);
			resultListEleven=new ArrayList<List<String>>();
			List<String> top10DRGsWeightByMDC =new ArrayList<String>();
			if(top10DRGsWeightByMDCList.size()<1){
				top10DRGsWeightByMDC =new ArrayList<String>();
				top10DRGsWeightByMDC.add("-");
				top10DRGsWeightByMDC.add("-");
				top10DRGsWeightByMDC.add("-");
				top10DRGsWeightByMDC.add("-");
				top10DRGsWeightByMDC.add("-");
				top10DRGsWeightByMDC.add("-");
				top10DRGsWeightByMDC.add("-");
				resultListEleven.add(top10DRGsWeightByMDC);
			}else{
				double MDCtotalWeigt = 0.00;
				double MDCtop10DRGstotalWeigt = 0.00;
				String MDCtop10DRGsWeigtRatio ="";
				for(Map<String, Object> weightobj:top10DRGsWeightByMDCList){
					MDCtotalWeigt+=Double.valueOf(weightobj.get("TOTALWEIGHT")==null?"0":weightobj.get("TOTALWEIGHT").toString().trim());
				}
				int top10DRGsWeightByMDCListN=1;
				int n=0;
				if(top10DRGsWeightByMDCList.size()<=10){
					n=top10DRGsWeightByMDCList.size();
				}else{
					n=10;
				}
				for(int i=0;i<n;i++){
					Map<String, Object> obj = top10DRGsWeightByMDCList.get(i);
					top10DRGsWeightByMDC =new ArrayList<String>();
					MDCtop10DRGstotalWeigt+=Double.valueOf(obj.get("TOTALWEIGHT")==null?"0":obj.get("TOTALWEIGHT").toString().trim());
					String drgsWeightRatio=(Arith.mul(Arith.div(Double.valueOf(obj.get("TOTALWEIGHT")==null?"0":obj.get("TOTALWEIGHT").toString().trim()),MDCtotalWeigt, 4), 100))+"";					
					top10DRGsWeightByMDC.add(top10DRGsWeightByMDCListN+"");
					top10DRGsWeightByMDCListN++;
					top10DRGsWeightByMDC.add(obj.get("PARDRG_CODE")==null?"-":obj.get("PARDRG_CODE").toString().trim());
					top10DRGsWeightByMDC.add(obj.get("DRG_DESC")==null?"-":obj.get("DRG_DESC").toString().trim());
					top10DRGsWeightByMDC.add(Arith.dataFormat(obj.get("AS_WEIGHT")==null?"0":obj.get("AS_WEIGHT").toString().trim(),"1"));
					top10DRGsWeightByMDC.add(Arith.dataFormat(obj.get("CNT")==null?"0":obj.get("CNT").toString().trim(),"2"));
					top10DRGsWeightByMDC.add(Arith.dataFormat(obj.get("TOTALWEIGHT")==null?"0":obj.get("TOTALWEIGHT").toString().trim(),"1"));
					top10DRGsWeightByMDC.add(drgsWeightRatio);
					resultListEleven.add(top10DRGsWeightByMDC);
				}
				if(MDCtotalWeigt!=0&&MDCtop10DRGstotalWeigt!=0){
					MDCtop10DRGsWeigtRatio = (Arith.mul(Arith.div(MDCtop10DRGstotalWeigt,MDCtotalWeigt, 4), 100))+"%";
				}
				MDCtop10DRGstotalWeigt = Arith.round(MDCtop10DRGstotalWeigt, 2);
				params.put("MDCtop10DRGstotalWeigt", MDCtop10DRGstotalWeigt);
				params.put("MDCtop10DRGsWeigtRatio", MDCtop10DRGsWeigtRatio);
			}
			
			//获取医管局考核DRGs病组
			String drgCodes = dto.get("drgCodes")==null?"--":dto.get("drgCodes").toString().trim();
			drgCodes = drgCodes.replaceAll("\\s*", "");// 去除空格	
			String drgCodesStr="";
			int drgsNum=0;
			if (drgCodes.length() > 4) {
				String[] drgs = drgCodes.split("&");
				if (drgs.length > 1) {
					StringBuffer drgsCode = new StringBuffer();
					for (int x = 0; x < drgs.length; x++) {
						drgsCode.append("'" + drgs[x] + "',");
						drgsNum++;
					}
					if(drgsCode.length()>0){
						drgCodesStr=drgsCode.substring(0, drgsCode.lastIndexOf(","))+"";
					}
				}
			} else {
				drgCodesStr="'" + drgCodes + "'";
			}
			
			paramMap.put("drgCodes",drgCodesStr);
			List<Map<String, Object>>  drgCodesDescList = analysisDRGsReportApplication.findDRGSDesc(paramMap);
			String drgsStr="";
			//获取标杆名称
			String drgVersionDesc = analysisDRGsReportApplication.findVersionDesc(paramMap);
			String[] drgs = drgCodes.split("&");
			if(drgs.length!=drgCodesDescList.size()){
				for(int i=0;i<drgs.length;i++){
					for(int j=0;j<drgCodesDescList.size();j++){
						Map<String, Object> obj = drgCodesDescList.get(j);
						String drgsCode = obj.get("DRG_CODE")+"";
						String drgsCodeWrite = drgs[i];
						if(drgsCodeWrite.equals(drgsCode)){
							drgs[i]="";
						}
					}
				}
				for(Map<String, Object> obj:drgCodesDescList){
					drgsStr+=obj.get("DRG_CODE")+"-"+obj.get("DRG_DESC")+"、";
				}
		        for (int j = 0; j < drgs.length; j++){
		            if (!"".equals(drgs[j]) ){
		            	String drgsCode = drgs[j];
		                drgsStr+=drgsCode+"（"+drgVersionDesc+"分组器中未找到该DRG组）、";
		            }
		        }
				if(drgsStr.length()>0){
					drgsStr= drgsStr.substring(0, drgsStr.lastIndexOf("、"))+"";
				}
			}else{
				for(Map<String, Object> obj:drgCodesDescList){
					drgsStr+=obj.get("DRG_CODE")+"-"+obj.get("DRG_DESC")+"、";
				}
				if(drgsStr.length()>0){
					drgsStr= drgsStr.substring(0, drgsStr.lastIndexOf("、"))+"";
				}
			}
			
			params.put("drgsStr", drgsStr);
			params.put("drgsNum", drgsNum);
			params.put("drgVersionInfo", drgVersionDesc);
			
			//表格12 获取医管局考核病组数据
			resultListTwelve=new ArrayList<List<String>>();
			if(drgCodesDescList.size()<1){
				List<String> DRGsQuota =new ArrayList<String>();
				DRGsQuota.add("-");
				DRGsQuota.add("-");
				DRGsQuota.add("-");
				DRGsQuota.add("-");
				DRGsQuota.add("-");
				DRGsQuota.add("-");
				DRGsQuota.add("-");
				resultListTwelve.add(DRGsQuota);
			}else{			
				for(Map<String, Object> obj:drgCodesDescList){
				String drgCode=obj.get("DRG_CODE")+"";
				String dateFrom=dto.get("dateFrom")==null?"":dto.get("dateFrom").toString();  //起始日期
				String dateTo=dto.get("dateTo")==null?"":dto.get("dateTo").toString();        //终止日期
				String dateFromSum=dateFrom.substring(0,4)+"-01-01";  //累计值起始日期
				String dateFromOneCc = DrgsIndex.getDateFromCc(dateFrom,"year");//起始日期同期
				String dateFromTwoCc = DrgsIndex.getDateFromCc(dateFromOneCc,"year");//起始日期同期的同期(两年前)
				String dateFromCcOne = dateFromOneCc.substring(0,4)+"-01-01";//一年前初始日期
				String dateToCcOne = dateFromOneCc.substring(0,4)+"-12-31";//一年前终止日期
				String dateFromCcTwo = dateFromTwoCc.substring(0,4)+"-01-01";//两年前起始日期
				String dateToCcTwo = dateFromTwoCc.substring(0,4)+"-12-31";//两年前终止日期
				String dataName = "";//表格中本期日期名称
				String analysismonthfrom="";
				String analysismonthto="";
				if(dateFrom.substring(5,6).equals("0")){
					analysismonthfrom=dateFrom.substring(6, 7); 
				}else {
					analysismonthfrom=dateFrom.substring(5, 7);
				}
				if(dateTo.substring(5,6).equals("0")){
					analysismonthto=dateTo.substring(6, 7); 
				}else {
					analysismonthto=dateTo.substring(5, 7);
				}
				if(analysismonthfrom.equals(analysismonthto)){
					dataName=dateFrom.substring(0,4)+"年"+analysismonthfrom+"月";
				}else{
					dataName=dateFrom.substring(0,4)+"年"+analysismonthfrom+"至"+analysismonthto+"月";
				}
				//表格12-本期值
				List<Map<String, Object>>  DRGsQuotaNowList = analysisDRGsReportApplication.findDRGsQuotaList(paramMap,dateFrom,dateTo,drgCode);
				if(DRGsQuotaNowList.size()>0){
					Map<String, Object> drgsQuotaNowobj = DRGsQuotaNowList.get(0);
					List<String> DRGsQuotaNow =new ArrayList<String>();
					DRGsQuotaNow.add(drgsQuotaNowobj.get("DRGDESC")==null?"-":drgsQuotaNowobj.get("DRGDESC").toString().trim());
					DRGsQuotaNow.add(dataName);
					DRGsQuotaNow.add(Arith.dataFormat(drgsQuotaNowobj.get("CNT")==null?"0":drgsQuotaNowobj.get("CNT").toString().trim(),"2"));
					DRGsQuotaNow.add(Arith.dataFormat(drgsQuotaNowobj.get("AS_WEIGHT")==null?"0.00":drgsQuotaNowobj.get("AS_WEIGHT").toString().trim(),"1"));
					DRGsQuotaNow.add(Arith.dataFormat(drgsQuotaNowobj.get("TOTALWEIGHT")==null?"0.00":drgsQuotaNowobj.get("TOTALWEIGHT").toString().trim(),"1"));
					DRGsQuotaNow.add(Arith.dataFormat(drgsQuotaNowobj.get("TIMEEFF")==null?"0.00":drgsQuotaNowobj.get("TIMEEFF").toString().trim(),"1"));
					DRGsQuotaNow.add(Arith.dataFormat(drgsQuotaNowobj.get("FEEEFF")==null?"0.00":drgsQuotaNowobj.get("FEEEFF").toString().trim(),"1"));
					resultListTwelve.add(DRGsQuotaNow);		
				}
				//表格12-累计值
				List<Map<String, Object>>  DRGsQuotaSumList = analysisDRGsReportApplication.findDRGsQuotaList(paramMap,dateFromSum,dateTo,drgCode);
				if(DRGsQuotaSumList.size()>0){
					Map<String, Object> drgsQuotaSumobj=DRGsQuotaSumList.get(0);
					List<String> DRGsQuotaSum =new ArrayList<String>();
					DRGsQuotaSum.add("");
					DRGsQuotaSum.add(dateFrom.substring(0,4)+"年累计");
					DRGsQuotaSum.add(Arith.dataFormat(drgsQuotaSumobj.get("CNT")==null?"0":drgsQuotaSumobj.get("CNT").toString().trim(),"2"));
					DRGsQuotaSum.add(Arith.dataFormat(drgsQuotaSumobj.get("AS_WEIGHT")==null?"0.00":drgsQuotaSumobj.get("AS_WEIGHT").toString().trim(),"1"));
					DRGsQuotaSum.add(Arith.dataFormat(drgsQuotaSumobj.get("TOTALWEIGHT")==null?"0.00":drgsQuotaSumobj.get("TOTALWEIGHT").toString().trim(),"1"));
					DRGsQuotaSum.add(Arith.dataFormat(drgsQuotaSumobj.get("TIMEEFF")==null?"0.00":drgsQuotaSumobj.get("TIMEEFF").toString().trim(),"1"));
					DRGsQuotaSum.add(Arith.dataFormat(drgsQuotaSumobj.get("FEEEFF")==null?"0.00":drgsQuotaSumobj.get("FEEEFF").toString().trim(),"1"));
					resultListTwelve.add(DRGsQuotaSum);
				}
				//表格12-同期值（前一年）
				List<Map<String, Object>>  DRGsQuotaCcList = analysisDRGsReportApplication.findDRGsQuotaList(paramMap,dateFromCcOne,dateToCcOne,drgCode);
				if(DRGsQuotaCcList.size()>0){
					Map<String, Object> drgsQuotaCcobj=DRGsQuotaCcList.get(0);
					List<String> DRGsQuotaCc =new ArrayList<String>();
					DRGsQuotaCc.add("");
					DRGsQuotaCc.add(dateFromOneCc.substring(0,4)+"年");
					DRGsQuotaCc.add(Arith.dataFormat(drgsQuotaCcobj.get("CNT")==null?"0":drgsQuotaCcobj.get("CNT").toString().trim(),"2"));
					DRGsQuotaCc.add(Arith.dataFormat(drgsQuotaCcobj.get("AS_WEIGHT")==null?"0.00":drgsQuotaCcobj.get("AS_WEIGHT").toString().trim(),"1"));
					DRGsQuotaCc.add(Arith.dataFormat(drgsQuotaCcobj.get("TOTALWEIGHT")==null?"0.00":drgsQuotaCcobj.get("TOTALWEIGHT").toString().trim(),"1"));
					DRGsQuotaCc.add(Arith.dataFormat(drgsQuotaCcobj.get("TIMEEFF")==null?"0.00":drgsQuotaCcobj.get("TIMEEFF").toString().trim(),"1"));
					DRGsQuotaCc.add(Arith.dataFormat(drgsQuotaCcobj.get("FEEEFF")==null?"0.00":drgsQuotaCcobj.get("FEEEFF").toString().trim(),"1"));
					resultListTwelve.add(DRGsQuotaCc);
				}
				//表格12-同期值（前两年）
				List<Map<String, Object>>  DRGsQuotaTwoCcList = analysisDRGsReportApplication.findDRGsQuotaList(paramMap,dateFromCcTwo,dateToCcTwo,drgCode);
				if(DRGsQuotaTwoCcList.size()>0){
					Map<String, Object> drgsQuotaTwoCcobj=DRGsQuotaTwoCcList.get(0);
					List<String> DRGsQuotaTwoCc =new ArrayList<String>();
					DRGsQuotaTwoCc.add("");
					DRGsQuotaTwoCc.add(dateFromTwoCc.substring(0,4)+"年");
					DRGsQuotaTwoCc.add(Arith.dataFormat(drgsQuotaTwoCcobj.get("CNT")==null?"0":drgsQuotaTwoCcobj.get("CNT").toString().trim(),"2"));
					DRGsQuotaTwoCc.add(Arith.dataFormat(drgsQuotaTwoCcobj.get("AS_WEIGHT")==null?"0.00":drgsQuotaTwoCcobj.get("AS_WEIGHT").toString().trim(),"1"));
					DRGsQuotaTwoCc.add(Arith.dataFormat(drgsQuotaTwoCcobj.get("TOTALWEIGHT")==null?"0.00":drgsQuotaTwoCcobj.get("TOTALWEIGHT").toString().trim(),"1"));
					DRGsQuotaTwoCc.add(Arith.dataFormat(drgsQuotaTwoCcobj.get("TIMEEFF")==null?"0.00":drgsQuotaTwoCcobj.get("TIMEEFF").toString().trim(),"1"));
					DRGsQuotaTwoCc.add(Arith.dataFormat(drgsQuotaTwoCcobj.get("FEEEFF")==null?"0.00":drgsQuotaTwoCcobj.get("FEEEFF").toString().trim(),"1"));
					resultListTwelve.add(DRGsQuotaTwoCc);
				}
				//表格12-三年平均值
				List<Map<String, Object>>  DRGsQuotaThreeYearsAvgList = analysisDRGsReportApplication.findDRGsQuotaList(paramMap,dateFromCcTwo,dateTo,drgCode);
				if(DRGsQuotaThreeYearsAvgList.size()>0){
					Map<String, Object> drgsQuotaThreeYearsAvgobj=DRGsQuotaThreeYearsAvgList.get(0);
					List<String> DRGsQuotaThreeYearsAvg =new ArrayList<String>();
					DRGsQuotaThreeYearsAvg.add("");
					int cntAvg = Integer.parseInt(drgsQuotaThreeYearsAvgobj.get("CNT")+"");
					double totalWeightAvg = Double.valueOf(drgsQuotaThreeYearsAvgobj.get("TOTALWEIGHT")+"");
					DRGsQuotaThreeYearsAvg.add("三年平均");
					DRGsQuotaThreeYearsAvg.add(Arith.dataFormat(String.valueOf(cntAvg/3),"2"));
					DRGsQuotaThreeYearsAvg.add(Arith.dataFormat(drgsQuotaThreeYearsAvgobj.get("AS_WEIGHT")==null?"0.00":drgsQuotaThreeYearsAvgobj.get("AS_WEIGHT").toString().trim(),"1"));
					DRGsQuotaThreeYearsAvg.add(Arith.dataFormat(String.valueOf(Arith.round((totalWeightAvg/3),2)),"1"));
					DRGsQuotaThreeYearsAvg.add(Arith.dataFormat(drgsQuotaThreeYearsAvgobj.get("TIMEEFF")==null?"0.00":drgsQuotaThreeYearsAvgobj.get("TIMEEFF").toString().trim(),"1"));
					DRGsQuotaThreeYearsAvg.add(Arith.dataFormat(drgsQuotaThreeYearsAvgobj.get("FEEEFF")==null?"0.00":drgsQuotaThreeYearsAvgobj.get("FEEEFF").toString().trim(),"1"));
					resultListTwelve.add(DRGsQuotaThreeYearsAvg);
				}
			}	
		}

			
			//获取重点MDC专业缺失DRG
			List<Map<String, Object>>  findLostDRGsList = analysisDRGsReportApplication.findLostDRGsList(paramMap);
			resultListThirteen=new ArrayList<List<String>>();
			List<String> lostDRGsList =new ArrayList<String>();
			if(findLostDRGsList.size()<1){
				lostDRGsList =new ArrayList<String>();
				lostDRGsList.add("-");
				lostDRGsList.add("-");
				lostDRGsList.add("-");
				lostDRGsList.add("-");
				resultListThirteen.add(lostDRGsList);
			}else{
				int lostDRGsListN=1;
				for(Map<String, Object> obj:findLostDRGsList){
					lostDRGsList =new ArrayList<String>();
					lostDRGsList.add(lostDRGsListN+"");
					lostDRGsListN++;
					lostDRGsList.add(obj.get("DRG_CODE")==null?"-":obj.get("DRG_CODE").toString().trim());
					lostDRGsList.add(obj.get("DRG_DESC")==null?"-":obj.get("DRG_DESC").toString().trim());
					lostDRGsList.add(obj.get("AS_WEIGHT")==null?"#":obj.get("AS_WEIGHT").toString().trim());
					resultListThirteen.add(lostDRGsList);
				}
			}
			
		}
		
		//加载第六个章节信息
		public void loadARSixSection(Map<String, Object> dto, Map<String, Object> paramMap){
			//第一节 获取相同病组科室间消耗差异大病组
			List<Map<String, Object>> MaxDFeeEffDRGList = analysisDRGsReportApplication.findMaxDFeeEffDRGList(paramMap);
				//第一个符合条件的DRG
				Map<String, Object> drg1obj=MaxDFeeEffDRGList.get(0);
				String MaxDFeeEffDRG1=drg1obj.get("DRGCODE")+"";
				String MaxDFeeEffDRGDesc1=drg1obj.get("DRGDESC")+"";
				String feeStd1="";
				int MaxDFeeEffDRGCnt1=Integer.parseInt(drg1obj.get("CNT")+"");
				List<Map<String, Object>> MaxDFeeEffDRGDepList1 = analysisDRGsReportApplication.findMaxDFeeEffDRGDepList(paramMap,MaxDFeeEffDRG1);
				int mindepNum1=0;
				String maxFeeDepDesc1="";
				String minFeeDepDesc1="";
				String maxFeeDepFee1="";
				String minFeeDepFee1="";
				for(Map<String, Object> depobj1:MaxDFeeEffDRGDepList1){
					feeStd1=depobj1.get("STDFEE")+"";
					int MaxDFeeEffDRGDepCnt1 = Integer.parseInt(depobj1.get("DEPCNT")+"");
					if(MaxDFeeEffDRGDepCnt1>MaxDFeeEffDRGCnt1*0.05){
						mindepNum1++;	
						maxFeeDepDesc1 = depobj1.get("DEP")+"";
						maxFeeDepFee1 = depobj1.get("AVGFEE")+"";
					}
					if(mindepNum1==1){
						minFeeDepDesc1 = depobj1.get("DEP")+"";
						minFeeDepFee1= depobj1.get("AVGFEE")+"";
					}
				}				
				params.put("MaxDFeeEffDRG1", MaxDFeeEffDRG1);
				params.put("MaxDFeeEffDRGDesc1", MaxDFeeEffDRGDesc1);
				params.put("MaxDFeeEffDRGCnt1", Arith.dataFormat(MaxDFeeEffDRGCnt1+"", "2"));
				params.put("feeStd1", Arith.dataFormat(feeStd1,"2"));
				params.put("maxFeeDepDesc1", maxFeeDepDesc1);
				params.put("minFeeDepDesc1", minFeeDepDesc1);
				params.put("maxFeeDepFee1", Arith.dataFormat(maxFeeDepFee1, "2"));
				params.put("minFeeDepFee1", Arith.dataFormat(minFeeDepFee1, "2"));
				
				//第二个符合条件的DRG
				Map<String, Object> drg2obj=MaxDFeeEffDRGList.get(1);
				String MaxDFeeEffDRG2=drg2obj.get("DRGCODE")+"";
				String MaxDFeeEffDRGDesc2=drg2obj.get("DRGDESC")+"";
				String feeStd2="";
				int MaxDFeeEffDRGCnt2=Integer.parseInt(drg2obj.get("CNT")+"");
				List<Map<String, Object>> MaxDFeeEffDRGDepList2 = analysisDRGsReportApplication.findMaxDFeeEffDRGDepList(paramMap,MaxDFeeEffDRG2);
				int mindepNum2=0;
				String maxFeeDepDesc2="";
				String minFeeDepDesc2="";
				String maxFeeDepFee2="";
				String minFeeDepFee2="";
				for(Map<String, Object> depobj2:MaxDFeeEffDRGDepList2){
					feeStd2=depobj2.get("STDFEE")+"";
					int MaxDFeeEffDRGDepCnt2 = Integer.parseInt(depobj2.get("DEPCNT")+"");
					if(MaxDFeeEffDRGDepCnt2>MaxDFeeEffDRGCnt2*0.05){
						mindepNum2++;	
						maxFeeDepDesc2 = depobj2.get("DEP")+"";
						maxFeeDepFee2 = depobj2.get("AVGFEE")+"";
					}
					if(mindepNum2==2){
						minFeeDepDesc2 = depobj2.get("DEP")+"";
						minFeeDepFee2= depobj2.get("AVGFEE")+"";
					}
				}				
				params.put("MaxDFeeEffDRG2", MaxDFeeEffDRG2);
				params.put("MaxDFeeEffDRGDesc2", MaxDFeeEffDRGDesc2);
				params.put("MaxDFeeEffDRGCnt2", Arith.dataFormat(MaxDFeeEffDRGCnt2+"", "2"));
				params.put("feeStd2", Arith.dataFormat(feeStd2, "2"));
				params.put("maxFeeDepDesc2", maxFeeDepDesc2);
				params.put("minFeeDepDesc2", minFeeDepDesc2);
				params.put("maxFeeDepFee2", Arith.dataFormat(maxFeeDepFee2, "2"));
				params.put("minFeeDepFee2", Arith.dataFormat(minFeeDepFee2, "2"));

			//第二节 获取时间消耗指数、费用消耗指数大于1的病组个数
			List<Map<String, Object>> overTimeEffAndFeeEffList = analysisDRGsReportApplication.findoverTimeEffAndFeeEffList(paramMap);
			Map<String, Object> objover = overTimeEffAndFeeEffList.get(0);
			int drgsCntAll = Integer.parseInt(objover.get("CNT")+"");//总DRGs个数
			int drgsFeeOverCnt = Integer.parseInt(objover.get("FEEEFFOVER")+"");//费用消耗指数大于1的DRGs个数
			int drgsTimeOverCnt = Integer.parseInt(objover.get("TIMEEFFOVER")+"");//时间消耗指数大于1的DRGs个数
			double drgsFeeOverRatio = 0.00;
			double drgsTimeOverRatio = 0.00;
			if (drgsCntAll==0){
				drgsFeeOverRatio=0.00;
				drgsTimeOverRatio=0.00;
			}else {
				drgsFeeOverRatio = Arith.round(Arith.div(drgsFeeOverCnt*100, drgsCntAll), 2);
				drgsTimeOverRatio = Arith.round(Arith.div(drgsTimeOverCnt*100, drgsCntAll), 2);
			}
			
			params.put("drgsFeeOverCnt",drgsFeeOverCnt);
			params.put("drgsTimeOverCnt",drgsTimeOverCnt);
			params.put("drgsFeeOverRatio",drgsFeeOverRatio);
			params.put("drgsTimeOverRatio",drgsTimeOverRatio);
			
			//获取时间消耗指数前五的DRG
			List<Map<String, Object>> overFiveTimeEffList = analysisDRGsReportApplication.findoverFiveTimeEffList(paramMap);
			String overFiveTimeEffStr="";
			String overFiveTimeEffNum="";
			for(Map<String, Object> obj:overFiveTimeEffList){
				overFiveTimeEffStr+=obj.get("DRG")+"、";
				overFiveTimeEffNum+=obj.get("TIMEEFF")+"、";
			}
			if(overFiveTimeEffStr.length()>0){
				overFiveTimeEffStr= overFiveTimeEffStr.substring(0, overFiveTimeEffStr.lastIndexOf("、"))+"";
				overFiveTimeEffNum= overFiveTimeEffNum.substring(0, overFiveTimeEffNum.lastIndexOf("、"))+"";
			}
			params.put("overFiveTimeEffStr",overFiveTimeEffStr);
			params.put("overFiveTimeEffNum",overFiveTimeEffNum);
			
			//获取费用消耗指数前五的DRG
			List<Map<String, Object>> overFiveFeeEffList = analysisDRGsReportApplication.findoverFiveFeeEffList(paramMap);
			String overFiveFeeEffStr="";
			String overFiveFeeEffNum="";
			for(Map<String, Object> obj:overFiveFeeEffList){
				overFiveFeeEffStr+=obj.get("DRG")+"、";
				overFiveFeeEffNum+=obj.get("FEEEFF")+"、";
			}
			if(overFiveFeeEffStr.length()>0){
				overFiveFeeEffStr= overFiveFeeEffStr.substring(0, overFiveFeeEffStr.lastIndexOf("、"))+"";
				overFiveFeeEffNum= overFiveFeeEffNum.substring(0, overFiveFeeEffNum.lastIndexOf("、"))+"";
			}
			params.put("overFiveFeeEffStr",overFiveFeeEffStr);
			params.put("overFiveFeeEffNum",overFiveFeeEffNum);
		}
		
		//加载附表信息
		public void loadARAttachedListSection(Map<String, Object> dto, Map<String, Object> paramMap){
			//附表1:全院及各科室医疗服务综合能力情况表
			List<Map<String, Object>> hospAbilityList = analysisDRGsReportApplication.findHospAbilityList(paramMap);
			resultListFBOne=new ArrayList<List<String>>();
			List<String> hospAbilityListT =new ArrayList<String>();
			if(hospAbilityList.size()<1){
				hospAbilityListT =new ArrayList<String>();
				hospAbilityListT.add("-");
				hospAbilityListT.add("全院");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				resultListFBOne.add(hospAbilityListT);
			}else{
				for(Map<String, Object> obj:hospAbilityList){
					hospAbilityListT =new ArrayList<String>();
					hospAbilityListT.add("-");
					hospAbilityListT.add("-");
					hospAbilityListT.add("全院");
					hospAbilityListT.add("-");
					hospAbilityListT.add(Arith.dataFormat(obj.get("TOTALCASECNT")==null?"0":obj.get("TOTALCASECNT").toString().trim(),"2"));
					hospAbilityListT.add(Arith.dataFormat(obj.get("INCASECNT")==null?"0":obj.get("INCASECNT").toString().trim(),"2"));
					hospAbilityListT.add(obj.get("CMI")==null?"0":obj.get("CMI").toString().trim());
					hospAbilityListT.add(obj.get("DRGS")==null?"0":obj.get("DRGS").toString().trim());
					hospAbilityListT.add(Arith.dataFormat(obj.get("WEIGHT")==null?"0":obj.get("WEIGHT").toString().trim(),"3"));
					hospAbilityListT.add(obj.get("TIME")==null?"0":obj.get("TIME").toString().trim());
					hospAbilityListT.add(obj.get("FEE")==null?"0":obj.get("FEE").toString().trim());
					hospAbilityListT.add(obj.get("ARATIO")==null?"0":obj.get("ARATIO").toString().trim());
					hospAbilityListT.add(obj.get("BRATIO")==null?"0":obj.get("BRATIO").toString().trim());
					hospAbilityListT.add(obj.get("CRATIO")==null?"0":obj.get("CRATIO").toString().trim());
					hospAbilityListT.add(obj.get("DRATIO")==null?"0":obj.get("DRATIO").toString().trim());
					resultListFBOne.add(hospAbilityListT);
				}
			}
			
			//附表1:各科室医疗服务综合能力情况部分
			String dateFrom=dto.get("dateFrom")==null?"":dto.get("dateFrom").toString();  //起始日期
			String dateTo=dto.get("dateTo")==null?"":dto.get("dateTo").toString();        //终止日期
			List<Map<String, Object>> allDepAbilityList = analysisDRGsReportApplication.findAllDepAbilityList(paramMap,dateFrom,dateTo);
			if(allDepAbilityList.size()<1){
				hospAbilityListT =new ArrayList<String>();
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				hospAbilityListT.add("-");
				resultListFBOne.add(hospAbilityListT);
			}else{
				int allDepAbilityListN=1;
				for(Map<String, Object> obj:allDepAbilityList){
					hospAbilityListT =new ArrayList<String>();
					hospAbilityListT.add(allDepAbilityListN+"");
					allDepAbilityListN++;
					hospAbilityListT.add(obj.get("DEP_TYPE")==null?"0":obj.get("DEP_TYPE").toString().trim());
					hospAbilityListT.add(obj.get("DECC")==null?"0":obj.get("DECC").toString().trim());
					hospAbilityListT.add(Arith.dataFormat(obj.get("SCORE")==null?"0":obj.get("SCORE").toString().trim(),"1"));
					hospAbilityListT.add(Arith.dataFormat(obj.get("TOTALCASECNT")==null?"0":obj.get("TOTALCASECNT").toString().trim(),"2"));
					hospAbilityListT.add(Arith.dataFormat(obj.get("INCASECNT")==null?"0":obj.get("INCASECNT").toString().trim(),"2"));
					hospAbilityListT.add(Arith.dataFormat(obj.get("CMI")==null?"0":obj.get("CMI").toString().trim(),"1"));
					hospAbilityListT.add(obj.get("DRGCOUNT")==null?"0":obj.get("DRGCOUNT").toString().trim());
					hospAbilityListT.add(Arith.dataFormat(obj.get("TOTALWEIGHT")==null?"0":obj.get("TOTALWEIGHT").toString().trim(),"3"));
					hospAbilityListT.add(obj.get("TIMEEFF")==null?"0":obj.get("TIMEEFF").toString().trim());
					hospAbilityListT.add(obj.get("FEEEFF")==null?"0":obj.get("FEEEFF").toString().trim());
					hospAbilityListT.add(obj.get("RISK1RATIO")==null?"0":obj.get("RISK1RATIO").toString().trim());
					hospAbilityListT.add(obj.get("RISK2RATIO")==null?"0":obj.get("RISK2RATIO").toString().trim());
					hospAbilityListT.add(obj.get("RISK3RATIO")==null?"0":obj.get("RISK3RATIO").toString().trim());
					hospAbilityListT.add(obj.get("RISK4RATIO")==null?"0":obj.get("RISK4RATIO").toString().trim());
					resultListFBOne.add(hospAbilityListT);
				}
			}
			
			//附表2 各手术科室入组病例最多的三个DRG病组指标情况
			List<Map<String, Object>> operDepList = analysisDRGsReportApplication.findOperDepList(paramMap);
		    String operDep="";
		    int operDepN=1;
		    resultListFBTwo=new ArrayList<List<String>>();
		    List<String> operDepDrgList =new ArrayList<String>();
		    if(operDepList.size()<1){
		    	operDepDrgList =new ArrayList<String>();
		    	operDepDrgList.add("-");
		    	operDepDrgList.add("-");
		    	operDepDrgList.add("-");
		    	operDepDrgList.add("-");
		    	operDepDrgList.add("-");
		    	operDepDrgList.add("-");
		    	operDepDrgList.add("-");
		    	operDepDrgList.add("-");
		    	operDepDrgList.add("-");
				resultListFBTwo.add(operDepDrgList);
			}else{
			    for(Map<String, Object> obj:operDepList){
			    	int depDeaRiskACnt = 0;
			    	operDep=obj.get("DEP_CODE")==null?"":obj.get("DEP_CODE").toString().trim();
			    	//获取该手术科室所有DRGS
			    	List<Map<String, Object>> operDepDrgsList = analysisDRGsReportApplication.findOperDepDrgsListList(paramMap,operDep);
			    	for(Map<String, Object> depDrgobj:operDepDrgsList){
			    		depDeaRiskACnt+=Integer.parseInt(depDrgobj.get("DRGCNT")==null?"0":depDrgobj.get("DRGCNT").toString().trim());
			    	}
			    	int n=0;
			    	if(operDepDrgsList.size()<=3){
			    		n=operDepDrgsList.size();
			    	}else{
			    		n=3;
			    	}
			    	for(int i=0;i<n;i++){
			    		operDepDrgList =new ArrayList<String>();
			    		Map<String, Object> drgobj = operDepDrgsList.get(i);		    		
			    		if(i==0){
			    			operDepDrgList.add(operDepN+"");
			    			operDepN++;
			    			operDepDrgList.add(drgobj.get("DEP")==null?"":drgobj.get("DEP").toString().trim());
			    		}else{
			    			operDepDrgList.add("");
			    			operDepDrgList.add("");
			    		}
		    			operDepDrgList.add(drgobj.get("DRG")==null?"":drgobj.get("DRG").toString().trim());
		    			operDepDrgList.add(drgobj.get("AS_WEIGHT")==null?"0":drgobj.get("AS_WEIGHT").toString().trim());
		    			operDepDrgList.add(Arith.dataFormat(drgobj.get("TOTALWEIGHT")==null?"0":drgobj.get("TOTALWEIGHT").toString().trim(),"3"));
		    			operDepDrgList.add(drgobj.get("TIMEEFF")==null?"0":drgobj.get("TIMEEFF").toString().trim());
		    			operDepDrgList.add(drgobj.get("FEEEFF")==null?"0":drgobj.get("FEEEFF").toString().trim());
		    			operDepDrgList.add(drgobj.get("DRGCNT")==null?"0":drgobj.get("DRGCNT").toString().trim());
		    			operDepDrgList.add((Arith.mul(Arith.div(Double.valueOf(drgobj.get("DRGCNT")+""), Double.valueOf(depDeaRiskACnt), 4), 100))+"");
		    			resultListFBTwo.add(operDepDrgList);
			    		
			    	}
			    }
			}
		    
			//附表3 全院及各MDC专业DRG病组覆盖情况及医疗服务综合能力情况表
			List<Map<String, Object>> hospallDRGsList = analysisDRGsReportApplication.findHospallDRGsList(paramMap);
		    String hospallDRGsListA="";
		    String hospallDRGsListB="";
		    for(Map<String, Object> obj:hospallDRGsList){
		    	hospallDRGsListA=obj.get("CNT")==null?"0":obj.get("CNT").toString().trim();
			    hospallDRGsListB=obj.get("RADIO")==null?"0":obj.get("RADIO").toString().trim();
		    }
		    
		    resultListFBThree=new ArrayList<List<String>>();
		    List<String> hospallDRGsListT =new ArrayList<String>();
		    
			if(hospAbilityList.size()<1){
				hospallDRGsListT =new ArrayList<String>();
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("全院");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				resultListFBThree.add(hospallDRGsListT);
			}else{
				for(Map<String, Object> obj:hospAbilityList){
					hospallDRGsListT =new ArrayList<String>();
					hospallDRGsListT.add("-");
					hospallDRGsListT.add("全院");
					hospallDRGsListT.add("-");
					hospallDRGsListT.add(Arith.dataFormat(obj.get("INCASECNT")==null?"0":obj.get("INCASECNT").toString().trim(),"2"));
					hospallDRGsListT.add(hospallDRGsListA);
					hospallDRGsListT.add(hospallDRGsListB);
					hospallDRGsListT.add(obj.get("CMI")==null?"0":obj.get("CMI").toString().trim());
					hospallDRGsListT.add(obj.get("DRGS")==null?"0":obj.get("DRGS").toString().trim());
					hospallDRGsListT.add(Arith.dataFormat(obj.get("WEIGHT")==null?"0":obj.get("WEIGHT").toString().trim(),"3"));
					hospallDRGsListT.add(obj.get("TIME")==null?"0":obj.get("TIME").toString().trim());
					hospallDRGsListT.add(obj.get("FEE")==null?"0":obj.get("FEE").toString().trim());
					hospallDRGsListT.add(obj.get("ARATIO")==null?"0":obj.get("ARATIO").toString().trim());
					hospallDRGsListT.add(obj.get("BRATIO")==null?"0":obj.get("BRATIO").toString().trim());
					hospallDRGsListT.add(obj.get("CRATIO")==null?"0":obj.get("CRATIO").toString().trim());
					hospallDRGsListT.add(obj.get("DRATIO")==null?"0":obj.get("DRATIO").toString().trim());
					resultListFBThree.add(hospallDRGsListT);
				}
			}
			//附表3 各MDC专业DRG病组覆盖情况及医疗服务综合能力情况
			List<Map<String, Object>> allmdcDRGsList = analysisDRGsReportApplication.findAllmdcDRGsList(paramMap);
			if(allmdcDRGsList.size()<1){
				hospallDRGsListT =new ArrayList<String>();
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				hospallDRGsListT.add("-");
				resultListFBThree.add(hospallDRGsListT);
			}else{
				int allmdcDRGsListN=1;
				for(Map<String, Object> obj:allmdcDRGsList){
					hospallDRGsListT =new ArrayList<String>();
					hospallDRGsListT.add(allmdcDRGsListN+"");
					allmdcDRGsListN++;
					hospallDRGsListT.add(obj.get("CODE")==null?"0":obj.get("CODE").toString().trim());
					hospallDRGsListT.add(obj.get("DECC")==null?"0":obj.get("DECC").toString().trim());
					hospallDRGsListT.add(Arith.dataFormat(obj.get("ACNT")==null?"0":obj.get("ACNT").toString().trim(),"2"));
					hospallDRGsListT.add(Arith.dataFormat(obj.get("BCNT")==null?"0":obj.get("BCNT").toString().trim(),"2"));
					hospallDRGsListT.add(Arith.dataFormat(obj.get("BRATIO")==null?"0":obj.get("BRATIO").toString().trim(),"1"));
					hospallDRGsListT.add(Arith.dataFormat(obj.get("CMI")==null?"0":obj.get("CMI").toString().trim(),"1"));
					hospallDRGsListT.add(obj.get("CCNT")==null?"0":obj.get("CCNT").toString().trim());
					hospallDRGsListT.add(Arith.dataFormat(obj.get("WEIGHT")==null?"0":obj.get("WEIGHT").toString().trim(),"3"));
					hospallDRGsListT.add(obj.get("TIME")==null?"0":obj.get("TIME").toString().trim());
					hospallDRGsListT.add(obj.get("FEE")==null?"0":obj.get("FEE").toString().trim());
					hospallDRGsListT.add(obj.get("RISK1RATIO")==null?"0":obj.get("RISK1RATIO").toString().trim());
					hospallDRGsListT.add(obj.get("RISK2RATIO")==null?"0":obj.get("RISK2RATIO").toString().trim());
					hospallDRGsListT.add(obj.get("RISK3RATIO")==null?"0":obj.get("RISK3RATIO").toString().trim());
					hospallDRGsListT.add(obj.get("RISK4RATIO")==null?"0":obj.get("RISK4RATIO").toString().trim());
					resultListFBThree.add(hospallDRGsListT);
				}
				params.put("allmdcDRGsListN",allmdcDRGsListN-1);//全院MDC个数
			}
		
			//附表4  住院病例DRG总权重最高的二十位主治医师
			List<Map<String, Object>> docByWeightList = analysisDRGsReportApplication.findDocByWeightList(paramMap);
			resultListFBFour=new ArrayList<List<String>>();
			List<String> docByWeightListT =new ArrayList<String>();
			if(docByWeightList.size()<1){
				docByWeightListT =new ArrayList<String>();
				docByWeightListT.add("-");
				docByWeightListT.add("-");
				docByWeightListT.add("-");
				docByWeightListT.add("-");
				docByWeightListT.add("-");
				docByWeightListT.add("-");
				docByWeightListT.add("-");
				docByWeightListT.add("-");
				docByWeightListT.add("-");
				docByWeightListT.add("-");
				docByWeightListT.add("-");
				docByWeightListT.add("-");
				docByWeightListT.add("-");
				resultListFBFour.add(docByWeightListT);
			}else{
				int docByWeightListN=1;
				for(Map<String, Object> obj:docByWeightList){
					if(docByWeightListN<=20){
						docByWeightListT =new ArrayList<String>();
						docByWeightListT.add(docByWeightListN+"");
						docByWeightListN++;
						docByWeightListT.add(obj.get("DECC")==null?"0":obj.get("DECC").toString().trim());
						docByWeightListT.add(obj.get("DEP")==null?"0":obj.get("DEP").toString().trim());
						docByWeightListT.add(obj.get("CMI")==null?"0":obj.get("CMI").toString().trim());
						docByWeightListT.add(obj.get("DCNT")==null?"0":obj.get("DCNT").toString().trim());
						docByWeightListT.add(Arith.dataFormat(obj.get("WEIGHT")==null?"0":obj.get("WEIGHT").toString().trim(),"3"));
						docByWeightListT.add(Arith.dataFormat(obj.get("INCNT")==null?"0":obj.get("INCNT").toString().trim(),"2"));
						docByWeightListT.add(obj.get("TIME")==null?"0":obj.get("TIME").toString().trim());
						docByWeightListT.add(obj.get("FEE")==null?"0":obj.get("FEE").toString().trim());
						docByWeightListT.add(obj.get("RISK1RATIO")==null?"0":obj.get("RISK1RATIO").toString().trim());
						docByWeightListT.add(obj.get("RISK2RATIO")==null?"0":obj.get("RISK2RATIO").toString().trim());
						docByWeightListT.add(obj.get("RISK3RATIO")==null?"0":obj.get("RISK3RATIO").toString().trim());
						docByWeightListT.add(obj.get("RISK4RATIO")==null?"0":obj.get("RISK4RATIO").toString().trim());
						resultListFBFour.add(docByWeightListT);
					}
				}
			}
			
			//附表5 CMI值最高的二十位主治医师
			List<Map<String, Object>> docByCMIList = analysisDRGsReportApplication.findDocByCMIList(paramMap);
			resultListFBFive=new ArrayList<List<String>>();
			List<String> docByCMIListT =new ArrayList<String>();
			if(docByCMIList.size()<1){
				docByCMIListT =new ArrayList<String>();
				docByCMIListT.add("-");
				docByCMIListT.add("-");
				docByCMIListT.add("-");
				docByCMIListT.add("-");
				docByCMIListT.add("-");
				docByCMIListT.add("-");
				docByCMIListT.add("-");
				docByCMIListT.add("-");
				docByCMIListT.add("-");
				docByCMIListT.add("-");
				docByCMIListT.add("-");
				docByCMIListT.add("-");
				docByCMIListT.add("-");
				resultListFBFive.add(docByCMIListT);
			}else{
				int docByCMIListN=1;
				for(Map<String, Object> obj:docByCMIList){
					if(docByCMIListN<=20){
						docByCMIListT =new ArrayList<String>();
						docByCMIListT.add(docByCMIListN+"");
						docByCMIListN++;
						docByCMIListT.add(obj.get("DECC")==null?"0":obj.get("DECC").toString().trim());
						docByCMIListT.add(obj.get("DEP")==null?"0":obj.get("DEP").toString().trim());
						docByCMIListT.add(obj.get("CMI")==null?"0":obj.get("CMI").toString().trim());
						docByCMIListT.add(obj.get("DCNT")==null?"0":obj.get("DCNT").toString().trim());
						docByCMIListT.add(Arith.dataFormat(obj.get("WEIGHT")==null?"0":obj.get("WEIGHT").toString().trim(),"3"));
						docByCMIListT.add(Arith.dataFormat(obj.get("INCNT")==null?"0":obj.get("INCNT").toString().trim(),"2"));
						docByCMIListT.add(obj.get("TIME")==null?"0":obj.get("TIME").toString().trim());
						docByCMIListT.add(obj.get("FEE")==null?"0":obj.get("FEE").toString().trim());
						docByCMIListT.add(obj.get("RISK1RATIO")==null?"0":obj.get("RISK1RATIO").toString().trim());
						docByCMIListT.add(obj.get("RISK2RATIO")==null?"0":obj.get("RISK2RATIO").toString().trim());
						docByCMIListT.add(obj.get("RISK3RATIO")==null?"0":obj.get("RISK3RATIO").toString().trim());
						docByCMIListT.add(obj.get("RISK4RATIO")==null?"0":obj.get("RISK4RATIO").toString().trim());
						resultListFBFive.add(docByCMIListT);
					}
				}
			}
			//附表6 未入组病例覆盖的所有主要诊断
			List<Map<String, Object>> oldNotInGroupDiagList = analysisDRGsReportApplication.findOldNotInGroupDiagList(paramMap);
			resultListFBSix=new ArrayList<List<String>>();
			List<String> oldNotInGroupDiagListT =new ArrayList<String>();
			if (oldNotInGroupDiagList.size() <1) {
				oldNotInGroupDiagListT =new ArrayList<String>();
				oldNotInGroupDiagListT.add("-");
				oldNotInGroupDiagListT.add("-");
				oldNotInGroupDiagListT.add("-");
				oldNotInGroupDiagListT.add("-");
				oldNotInGroupDiagListT.add("-");
				oldNotInGroupDiagListT.add("-");
				oldNotInGroupDiagListT.add("-");
				oldNotInGroupDiagListT.add("-");
				oldNotInGroupDiagListT.add("-");
				oldNotInGroupDiagListT.add("-");
				resultListFBSix.add(oldNotInGroupDiagListT);
			}else {
				int leftcnt=0;
				//判断是奇数的情况
				if(oldNotInGroupDiagList.size()%2==1){
					 leftcnt=(oldNotInGroupDiagList.size()+1)/2;
				}else{
					//当为偶数的情况
				     leftcnt=oldNotInGroupDiagList.size()/2;
				}
				for (int j = 0; j < leftcnt; j++) {
					//当为奇数最后一位右边设置为空
					if((oldNotInGroupDiagList.size()%2==1)&&(j==leftcnt-1)){
						Map<String, Object> objL=oldNotInGroupDiagList.get(j);
						oldNotInGroupDiagListT =new ArrayList<String>();
						oldNotInGroupDiagListT.add(j+1+"");
						oldNotInGroupDiagListT.add(objL.get("CODE")==null?"-":(objL.get("CODE")+"").trim());
						oldNotInGroupDiagListT.add(objL.get("DECC")==null?"-":(objL.get("DECC")+"").trim());
						oldNotInGroupDiagListT.add(Arith.dataFormat(objL.get("CNT")==null?"0":objL.get("CNT").toString().trim(),"2"));
						oldNotInGroupDiagListT.add(objL.get("RATIO")==null?"-":(objL.get("RATIO")+"").trim());
						oldNotInGroupDiagListT.add("");
						oldNotInGroupDiagListT.add("");
						oldNotInGroupDiagListT.add("");
						oldNotInGroupDiagListT.add("");
						oldNotInGroupDiagListT.add("");
						resultListFBSix.add(oldNotInGroupDiagListT);
					}else{
						Map<String, Object> objL=oldNotInGroupDiagList.get(j);
						Map<String, Object> objR=oldNotInGroupDiagList.get(j+leftcnt);
						oldNotInGroupDiagListT =new ArrayList<String>();
						oldNotInGroupDiagListT.add(j+1+"");
						oldNotInGroupDiagListT.add(objL.get("CODE")==null?"-":(objL.get("CODE")+"").trim());
						oldNotInGroupDiagListT.add(objL.get("DECC")==null?"-":(objL.get("DECC")+"").trim());
						oldNotInGroupDiagListT.add(Arith.dataFormat(objL.get("CNT")==null?"0":objL.get("CNT").toString().trim(),"2"));
						oldNotInGroupDiagListT.add(objL.get("RATIO")==null?"-":(objL.get("RATIO")+"").trim());
						oldNotInGroupDiagListT.add((j+leftcnt+1)+"");
						oldNotInGroupDiagListT.add(objR.get("CODE")==null?"-":(objR.get("CODE")+"").trim());
						oldNotInGroupDiagListT.add(objR.get("DECC")==null?"-":(objR.get("DECC")+"").trim());
						oldNotInGroupDiagListT.add(Arith.dataFormat(objR.get("CNT")==null?"0":objR.get("CNT").toString().trim(),"2"));
						oldNotInGroupDiagListT.add(objR.get("RATIO")==null?"-":(objR.get("RATIO")+"").trim());
						resultListFBSix.add(oldNotInGroupDiagListT);
					}
				}
			}
			//附表7 各科室医疗服务综合得分变化情况
			String dateFromCc = DrgsIndex.getDateFromCc(dateFrom,"year");//起始日期同期
			String dateToCc = DrgsIndex.getDateFromCc(dateTo,"year");//终止日期同期
			List<Map<String, Object>> depScoreList = analysisDRGsReportApplication.findAllDepAbilityList(paramMap,dateFrom,dateTo);
			List<Map<String, Object>> depScoreCcList = analysisDRGsReportApplication.findAllDepAbilityList(paramMap,dateFromCc,dateToCc);
			resultListFBSeven=new ArrayList<List<String>>();
			List<String> depScoreListT =new ArrayList<String>();
			List<Map<String, Object>> operresult = new ArrayList<Map<String, Object>>();
			List<Map<String, Object>> unoperresult = new ArrayList<Map<String, Object>>();
			List<Map<String, Object>> otheroperresult = new ArrayList<Map<String, Object>>();
			for(Map<String, Object> obj:depScoreList){
				for(Map<String, Object> objCc:depScoreCcList){
					String rateScore = "";//增长率   
					double score = Double.valueOf(obj.get("SCORE")==null?"0":(obj.get("SCORE")+"").trim());
					double scoreCc = Double.valueOf(objCc.get("SCORE")==null?"0":(objCc.get("SCORE")+"").trim());
					if(obj.get("DEP_TYPE").equals("外科")&&obj.get("DECC").equals(objCc.get("DECC"))){
						Map<String, Object> opermap = new HashMap<>();
						opermap.put("depType", obj.get("DEP_TYPE")==null?"":(obj.get("DEP_TYPE")+"").trim());
						opermap.put("depName", obj.get("DECC")==null?"":(obj.get("DECC")+"").trim());
						opermap.put("depScore", obj.get("SCORE")==null?"":(obj.get("SCORE")+"").trim());
						opermap.put("depScoreCc", objCc.get("SCORE")==null?"":(objCc.get("SCORE")+"").trim());
						if(score<scoreCc && scoreCc!=0){
							rateScore=Arith.round((score-scoreCc)/scoreCc*100, 2)+"%";
							opermap.put("rateScore",rateScore);
						}else if(score>scoreCc && scoreCc!=0){
							rateScore="+"+Arith.round((score-scoreCc)/scoreCc*100, 2)+"%";
							opermap.put("rateScore",rateScore);
						}else{
							opermap.put("rateScore","0.00");
						}
						operresult.add(opermap);
					}else if (obj.get("DEP_TYPE").equals("内科")&&obj.get("DECC").equals(objCc.get("DECC"))){
						Map<String, Object> unOpermap = new HashMap<>();
						unOpermap.put("depType", obj.get("DEP_TYPE")==null?"":(obj.get("DEP_TYPE")+"").trim());
						unOpermap.put("depName", obj.get("DECC")==null?"":(obj.get("DECC")+"").trim());
						unOpermap.put("depScore", obj.get("SCORE")==null?"":(obj.get("SCORE")+"").trim());
						unOpermap.put("depScoreCc", objCc.get("SCORE")==null?"":(objCc.get("SCORE")+"").trim());
						if(score<scoreCc && scoreCc!=0){
							rateScore=Arith.round((score-scoreCc)/scoreCc*100, 2)+"%";
							unOpermap.put("rateScore",rateScore);
						}else if(score>scoreCc && scoreCc!=0){
							rateScore="+"+Arith.round((score-scoreCc)/scoreCc*100, 2)+"%";
							unOpermap.put("rateScore",rateScore);
						}else{
							unOpermap.put("rateScore","0.00");
						}
						unoperresult.add(unOpermap);
					}else if (obj.get("DEP_TYPE").equals("其他")&&obj.get("DECC").equals(objCc.get("DECC"))){
						Map<String, Object> otherOpermap = new HashMap<>();
						otherOpermap.put("depType", obj.get("DEP_TYPE")==null?"":(obj.get("DEP_TYPE")+"").trim());
						otherOpermap.put("depName", obj.get("DECC")==null?"":(obj.get("DECC")+"").trim());
						otherOpermap.put("depScore", obj.get("SCORE")==null?"":(obj.get("SCORE")+"").trim());
						otherOpermap.put("depScoreCc", objCc.get("SCORE")==null?"":(objCc.get("SCORE")+"").trim());
						if(score<scoreCc && scoreCc!=0){
							rateScore=Arith.round((score-scoreCc)/scoreCc*100, 2)+"%";
							otherOpermap.put("rateScore",rateScore);
						}else if(score>scoreCc && scoreCc!=0){
							rateScore="+"+Arith.round((score-scoreCc)/scoreCc*100, 2)+"%";
							otherOpermap.put("rateScore",rateScore);
						}else{
							otherOpermap.put("rateScore","0.00");
						}
						otheroperresult.add(otherOpermap);
					}
				}
			}
			int opersize = operresult.size();
			int unopersize = unoperresult.size();
			int othopersize = otheroperresult.size();
			int sizemax=(opersize>unopersize?opersize:unopersize)>othopersize?(opersize>unopersize?opersize:unopersize):othopersize;

			int depScoreN = 1;
			for(int i=0;i<sizemax;i++){
				depScoreListT =new ArrayList<String>();
				Map<String, Object> operobj=new HashMap<String, Object>(); 
				Map<String, Object> unoperobj=new HashMap<String, Object>(); 
				Map<String, Object> otheroperobj=new HashMap<String, Object>(); 
				if(i<operresult.size()){
					operobj=operresult.get(i);
				}else{
					operobj.put("depType","");
					operobj.put("depName", "");
					operobj.put("depScore","");
					operobj.put("depScoreCc","");
				}
				if(i<unoperresult.size()){
					unoperobj=unoperresult.get(i);
				}else{
					unoperobj.put("depType","");
					unoperobj.put("depName", "");
					unoperobj.put("depScore","");
					unoperobj.put("depScoreCc","");
				}
				if(i<otheroperresult.size()){
					otheroperobj=otheroperresult.get(i);
				}else{
					otheroperobj.put("depType","");
					otheroperobj.put("depName", "");
					otheroperobj.put("depScore","");
					otheroperobj.put("depScoreCc","");
				}
				depScoreListT.add(depScoreN+"");
				depScoreN++;
				depScoreListT.add(operobj.get("depName")==null?"":(operobj.get("depName")+"").trim());
				depScoreListT.add(operobj.get("depScore")==null?"":(operobj.get("depScore")+"").trim());
				depScoreListT.add(operobj.get("depScoreCc")==null?"":(operobj.get("depScoreCc")+"").trim());
				depScoreListT.add(operobj.get("rateScore")==null?"":(operobj.get("rateScore")+"").trim());
				depScoreListT.add(unoperobj.get("depName")==null?"":(unoperobj.get("depName")+"").trim());
				depScoreListT.add(unoperobj.get("depScore")==null?"":(unoperobj.get("depScore")+"").trim());
				depScoreListT.add(unoperobj.get("depScoreCc")==null?"":(unoperobj.get("depScoreCc")+"").trim());
				depScoreListT.add(unoperobj.get("rateScore")==null?"":(unoperobj.get("rateScore")+"").trim());
				depScoreListT.add(otheroperobj.get("depName")==null?"":(otheroperobj.get("depName")+"").trim());
				depScoreListT.add(otheroperobj.get("depScore")==null?"":(otheroperobj.get("depScore")+"").trim());
				depScoreListT.add(otheroperobj.get("depScoreCc")==null?"":(otheroperobj.get("depScoreCc")+"").trim());
				depScoreListT.add(otheroperobj.get("rateScore")==null?"":(otheroperobj.get("rateScore")+"").trim());
				resultListFBSeven.add(depScoreListT);
			}
			//附表8 内科组/外科组/操作组病组明细
			List<Map<String, Object>> DRGTypeCntList = analysisDRGsReportApplication.findDRGTypeCntList(paramMap);
			resultListFBEight=new ArrayList<List<String>>();
			List<String> DRGTypeCntListT =new ArrayList<String>();
			if(DRGTypeCntList.size()<1){
				DRGTypeCntListT =new ArrayList<String>();
				DRGTypeCntListT.add("-");
				DRGTypeCntListT.add("-");
				DRGTypeCntListT.add("-");
				DRGTypeCntListT.add("-");
				DRGTypeCntListT.add("-");
				DRGTypeCntListT.add("-");
				DRGTypeCntListT.add("-");
				DRGTypeCntListT.add("-");
				DRGTypeCntListT.add("-");
				DRGTypeCntListT.add("-");
				resultListFBEight.add(DRGTypeCntListT);
			}else{
				int DRGTypeCntN=1;
				for(Map<String, Object> obj:DRGTypeCntList){
					DRGTypeCntListT =new ArrayList<String>();
					DRGTypeCntListT.add(DRGTypeCntN+"");
					DRGTypeCntN++;
					DRGTypeCntListT.add(obj.get("WDRGCODE")==null?"":obj.get("WDRGCODE").toString().trim());
					DRGTypeCntListT.add(obj.get("WDRGDESC")==null?"":obj.get("WDRGDESC").toString().trim());
					DRGTypeCntListT.add(obj.get("WCNT")==null?"":obj.get("WCNT").toString().trim());
					DRGTypeCntListT.add(obj.get("NDRGCODE")==null?"":obj.get("NDRGCODE").toString().trim());
					DRGTypeCntListT.add(obj.get("NDRGDESC")==null?"":obj.get("NDRGDESC").toString().trim());
					DRGTypeCntListT.add(obj.get("NCNT")==null?"":obj.get("NCNT").toString().trim());
					DRGTypeCntListT.add(obj.get("CDRGCODE")==null?"":obj.get("CDRGCODE").toString().trim());
					DRGTypeCntListT.add(obj.get("CDRGDESC")==null?"":obj.get("CDRGDESC").toString().trim());
					DRGTypeCntListT.add(obj.get("CCNT")==null?"":obj.get("CCNT").toString().trim());
					resultListFBEight.add(DRGTypeCntListT);
				}
			}
			//附表9 死亡病例明细
			List<Map<String, Object>> deadCntList = analysisDRGsReportApplication.findDeadCntList(paramMap);
			resultListFBNine=new ArrayList<List<String>>();
			List<String> deadCntListT =new ArrayList<String>();
			if(deadCntList.size()<1){
				deadCntListT =new ArrayList<String>();
				deadCntListT.add("-");
				deadCntListT.add("-");
				deadCntListT.add("-");
				deadCntListT.add("-");
				deadCntListT.add("-");
				deadCntListT.add("-");
				deadCntListT.add("-");
				deadCntListT.add("-");
				deadCntListT.add("-");
				deadCntListT.add("-");
				deadCntListT.add("-");
				deadCntListT.add("-");
				deadCntListT.add("-");
				deadCntListT.add("-");
				resultListFBNine.add(deadCntListT);
			}else{
				int deadCaseN=1;
				for(Map<String, Object> obj:deadCntList){
					deadCntListT =new ArrayList<String>();
					deadCntListT.add(deadCaseN+"");
					deadCaseN++;
					deadCntListT.add(obj.get("BAH")==null?"-":obj.get("BAH").toString().trim());
					deadCntListT.add(obj.get("NAME")==null?"-":obj.get("NAME").toString().trim());
					deadCntListT.add(obj.get("OUTDATE")==null?"-":obj.get("OUTDATE").toString().trim());
					deadCntListT.add(obj.get("OUTDEP")==null?"-":obj.get("OUTDEP").toString().trim());
					deadCntListT.add(obj.get("INDAYS")==null?"-":obj.get("INDAYS").toString().trim());
					deadCntListT.add(Arith.dataFormat(obj.get("FEE")==null?"0":obj.get("FEE").toString().trim(),"2"));
					deadCntListT.add(obj.get("MAINDIA")==null?"-":obj.get("MAINDIA").toString().trim());
					deadCntListT.add(obj.get("DRGCODE")==null?"-":obj.get("DRGCODE").toString().trim());
					deadCntListT.add(obj.get("DRGDESC")==null?"-":obj.get("DRGDESC").toString().trim());
					deadCntListT.add(obj.get("AS_WEIGHT")==null?"-":obj.get("AS_WEIGHT").toString().trim());
					deadCntListT.add(obj.get("AS_AVG_DAYS")==null?"-":obj.get("AS_AVG_DAYS").toString().trim());
					deadCntListT.add(obj.get("AS_AVG_FEE")==null?"-":obj.get("AS_AVG_FEE").toString().trim());
					deadCntListT.add(obj.get("RISK_LEVEL")==null?"-":obj.get("RISK_LEVEL").toString().trim());
					resultListFBNine.add(deadCntListT);
				}
			}
		}
		/**
		 * @methodname :imputedRatio
		 * @Description : 计算百分比
		 * @author:LiuHongjun
		 * @return Double
		 * @date :2016年9月10日
		 */
		public Double imputedRatio(Double a, Double b) {
			return Arith.mul(Arith.div(a, b, 4), 100);
		}
		//生成文档
		@Override
		public Map<String, Object> createDRGsReport() throws IOException {
			
			//1手术非手术占比
			Map<String,Object> picone = new HashMap<String, Object>();  
			picone.put("width", 220);
			picone.put("height", 220);
			picone.put("type", "jpg");
			picone.put("content", WordUtil.inputStream2ByteArray(new FileInputStream(picRootio+"picone.jpg"), true));  
		    params.put("picone",picone);
			
			//2构建手术级别分布
			Map<String,Object> pictwo = new HashMap<String, Object>();  
			pictwo.put("width", 220);
			pictwo.put("height", 220);
			pictwo.put("type", "jpg");
			pictwo.put("content", WordUtil.inputStream2ByteArray(new FileInputStream(picRootio+"pictwo.jpg"), true));  
		    params.put("pictwo",pictwo);
		    
		    //3构建各MDC专业本期和同期出院病例数分布条形图
		    Map<String,Object> picthree = new HashMap<String, Object>();  
		    picthree.put("width", 560);
		    picthree.put("height", 360);
		    picthree.put("type", "jpg");
		    picthree.put("content", WordUtil.inputStream2ByteArray(new FileInputStream(picRootio+"picthree.jpg"), true));  
		    params.put("picthree",picthree);
		    
		    //4构建DRGs病组复杂程度分布图
		    Map<String,Object> picfour = new HashMap<String, Object>();  
		    picfour.put("width", 400);
		    picfour.put("height", 320);
		    picfour.put("type", "jpg");
		    picfour.put("content", WordUtil.inputStream2ByteArray(new FileInputStream(picRootio+"picfour.jpg"), true));  
		    params.put("picfour",picfour);
		    
		    //5构建DRGs病例复杂程度分布图
		    Map<String,Object> picfive = new HashMap<String, Object>();  
		    picfive.put("width", 400);
		    picfive.put("height", 320);
		    picfive.put("type", "jpg");
		    picfive.put("content", WordUtil.inputStream2ByteArray(new FileInputStream(picRootio+"picfive.jpg"), true));  
		    params.put("picfive",picfive);
	    
		    //6构建各手术科室技术难度（CMI值）和医疗产出（总权重）象限分布图
		    Map<String,Object> picsix = new HashMap<String, Object>();  
		    picsix.put("width", 560);
		    picsix.put("height", 340);
		    picsix.put("type", "jpg");
		    picsix.put("content", WordUtil.inputStream2ByteArray(new FileInputStream(picRootio+"picsix.jpg"), true));  
		    params.put("picsix",picsix);
		    
		  //7构建各非手术科室技术难度（CMI值）和医疗产出（总权重）象限分布图
		    Map<String,Object> picseven = new HashMap<String, Object>();  
		    picseven.put("width", 560);
		    picseven.put("height", 340);
		    picseven.put("type", "jpg");
		    picseven.put("content", WordUtil.inputStream2ByteArray(new FileInputStream(picRootio+"picseven.jpg"), true));  
		    params.put("picseven",picseven);
		        
		    //8构建各手术科室费用和时间消耗指数象限分布图
		    Map<String,Object> piceight = new HashMap<String, Object>();  
		    piceight.put("width", 560);
		    piceight.put("height", 340);
		    piceight.put("type", "jpg");
		    piceight.put("content", WordUtil.inputStream2ByteArray(new FileInputStream(picRootio+"piceight.jpg"), true));  
		    params.put("piceight",piceight);
		    
			//9构建各非手术科室费用和时间消耗指数象限分布图
			Map<String,Object> picnine = new HashMap<String, Object>();  
			picnine.put("width", 560);
			picnine.put("height", 340);
			picnine.put("type", "jpg");
			picnine.put("content", WordUtil.inputStream2ByteArray(new FileInputStream(picRootio+"picnine.jpg"), true));  
		    params.put("picnine",picnine);
		    
			//10构建各MDC总权重分布图
			Map<String,Object> picten = new HashMap<String, Object>();  
			picten.put("width", 560);
			picten.put("height", 360);
			picten.put("type", "jpg");
			picten.put("content", WordUtil.inputStream2ByteArray(new FileInputStream(picRootio+"picten.jpg"), true));  
		    params.put("picten",picten);
		    
			//11构建各MDC总权重和CMI象限分布图
			Map<String,Object> piceleven = new HashMap<String, Object>();  
			piceleven.put("width", 560);
			piceleven.put("height", 340);
			piceleven.put("type", "jpg");
			piceleven.put("content", WordUtil.inputStream2ByteArray(new FileInputStream(picRootio+"piceleven.jpg"), true));  
		    params.put("piceleven",piceleven);
		    
			Map<String,Object> mapAR=new HashMap<String,Object>();
			  try{
				  CustomXWPFDocument doc =new CustomXWPFDocument();
				  String analysisReportRoot="";
				  analysisReportRoot="BZanalysisReport.docx"; //北肿模板
				  doc = WordUtil.generateWord(params, wordRootio+analysisReportRoot);
				  WordUtil.insertValueToTable(doc, resultListSeven, 7, true);//表格7
				  WordUtil.insertValueToTable(doc, resultListEight, 11, true);//表格8
				  WordUtil.insertValueToTable(doc, resultListNine, 12, true);//表格9
				  WordUtil.insertValueToTable(doc, resultListTen, 13, true);//表格10
				  WordUtil.insertValueToTable(doc, resultListEleven, 24, true);//表格11
				  WordUtil.insertValueToTable(doc, resultListTwelve, 25, true);//表格12
				  WordUtil.insertValueToTable(doc, resultListThirteen, 9, true);//表格13
				  
				  WordUtil.insertValueToTable(doc, resultListFBOne, 19, true);  //附表1
				  WordUtil.insertValueToTable(doc, resultListFBTwo, 20, true);  //附表2
				  WordUtil.insertValueToTable(doc, resultListFBThree, 21, true);//附表3
				  WordUtil.insertValueToTable(doc, resultListFBFour, 15, true); //附表4
				  WordUtil.insertValueToTable(doc, resultListFBFive, 16, true); //附表5
				  WordUtil.insertValueToTable(doc, resultListFBSix, 17, true); //附表6
				  WordUtil.insertValueToTable(doc, resultListFBSeven, 18, true); //附表7
				  WordUtil.insertValueToTable(doc, resultListFBEight, 22, true); //附表8
				  WordUtil.insertValueToTable(doc, resultListFBNine, 23, true); //附表9
				  
				  
				  reportNo = System.currentTimeMillis(); //生成文档结束时间
				  File folder = new File(writeRootio);
				  if (!folder.exists()) {
						folder.mkdirs();
					}
				 String outputFile = folder.getPath() + File.separator + reportNo + ".docx";
				 FileOutputStream fopts = new FileOutputStream(outputFile);
				 doc.write(fopts);
				 fopts.close();
				 System.err.println(" \n 文档生成成功 path=\n" + outputFile);
				 System.err.println("生成文档耗时time=" + (System.currentTimeMillis() - start) / 1000);
				 mapAR.put("patch", "tmp/"+reportNo+".docx");
				 mapAR.put("hospname", params.get("hospName")+"");
				 return mapAR;
              } catch (Exception e) {
				  e.printStackTrace();
			  }
			  return mapAR;
		}
		/**
		 * 
		* @ClassName: TestRunnable 
		* @Description: 线程 第一章节
		* @author sulina
		* @date 2017年12月29日 下午3:43:02 
		*
		 */
	private	class TestRunnableA implements Runnable { 
			private Map<String, Object> dto=new HashMap<String, Object>();
			TestRunnableA(Map<String, Object> dto){
				this.dto=dto;
			}
		    public void run() { 
		                    try {
		                    	    loadARFirstSection(dto);   
		                    } catch (Exception e) { 
		                            e.printStackTrace(); 
		                    } 
		      }
		}
	/**
	 * 
	* @ClassName: TestRunnable 
	* @Description: 线程 第二章节
	* @author shaozhiyuan
	* @date 2017年11月29日 下午3:43:02 
	*
	 */
   private	class TestRunnableB implements Runnable { 
		private Map<String, Object> dto=new HashMap<String, Object>();
		private Map<String, Object> map=new HashMap<String, Object>();
		TestRunnableB(Map<String, Object> dto,Map<String, Object> map){
			this.dto=dto;
			this.map=map;
		}
	    public void run() { 
	                    try {
	                    		loadARTwoSection(dto, map);  
	                    } catch (Exception e) { 
	                            e.printStackTrace(); 
	                    } 
	      }
	 }
	/**
	 * 
	* @ClassName: TestRunnable 
	* @Description: 线程 第三章节
	* @author shaozhiyuan
	* @date 2017年11月29日 下午3:43:02 
	*
	 */
  private	class TestRunnableC implements Runnable { 
		private Map<String, Object> dto=new HashMap<String, Object>();
		private Map<String, Object> map=new HashMap<String, Object>();
		TestRunnableC(Map<String, Object> dto,Map<String, Object> map){
			this.dto=dto;
			this.map=map;
		}
	    public void run() { 
	                    try {
	                    		loadARThreeSection(dto, map);   
	                    } catch (Exception e) { 
	                            e.printStackTrace(); 
	                    } 
	      }
	 }
	/**
	 * 
	* @ClassName: TestRunnable 
	* @Description: 线程 第四章节
	* @author shaozhiyuan
	* @date 2017年11月29日 下午3:43:02 
	*
	 */
 private	class TestRunnableD implements Runnable { 
		private Map<String, Object> dto=new HashMap<String, Object>();
		private Map<String, Object> map=new HashMap<String, Object>();
		TestRunnableD(Map<String, Object> dto,Map<String, Object> map){
			this.dto=dto;
			this.map=map;
		}
	    public void run() { 
	                    try {
	                    		loadARFourSection(dto, map);   
	                    } catch (Exception e) { 
	                            e.printStackTrace(); 
	                    } 
	      }
	 }
	/**
	 * 
	* @ClassName: TestRunnable 
	* @Description: 线程 第五章节
	* @author shaozhiyuan
	* @date 2017年11月29日 下午3:43:02 
	*
	 */
private	class TestRunnableE implements Runnable { 
		private Map<String, Object> dto=new HashMap<String, Object>();
		private Map<String, Object> map=new HashMap<String, Object>();
		TestRunnableE(Map<String, Object> dto,Map<String, Object> map){
			this.dto=dto;
			this.map=map;
		}
	    public void run() { 
	                    try {
	                    		loadARFiveSection(dto, map);   
	                    } catch (Exception e) { 
	                            e.printStackTrace(); 
	                    } 
	      }
	 }
/**
 * 
* @ClassName: TestRunnable 
* @Description: 线程 第六章节
* @author shaozhiyuan
* @date 2017年11月29日 下午3:43:02 
*
 */
private	class TestRunnableF implements Runnable { 
	private Map<String, Object> dto=new HashMap<String, Object>();
	private Map<String, Object> map=new HashMap<String, Object>();
	TestRunnableF(Map<String, Object> dto,Map<String, Object> map){
		this.dto=dto;
		this.map=map;
	}
    public void run() { 
                    try {
                    		loadARSixSection(dto, map);   
                    } catch (Exception e) { 
                            e.printStackTrace(); 
                    } 
      }
 }
/**
 * 
* @ClassName: TestRunnable 
* @Description: 线程  附表章节
* @author shaozhiyuan
* @date 2017年11月29日 下午3:43:02 
*
 */
private	class TestRunnableG implements Runnable { 
	private Map<String, Object> dto=new HashMap<String, Object>();
	private Map<String, Object> map=new HashMap<String, Object>();
	TestRunnableG(Map<String, Object> dto,Map<String, Object> map){
		this.dto=dto;
		this.map=map;
	}
    public void run() {
                    try {
                    		loadARAttachedListSection(dto, map);   
                    } catch (Exception e) { 
                            e.printStackTrace(); 
                    } 
         }
   }

}

